Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

Socket.IO

An asset by msabaeian
The page banner background of a mountain and forest
Socket.IO hero image

Quick Information

0 ratings
Socket.IO icon image
msabaeian
Socket.IO

Socket.IO and Engine.IO client addon that supports both HTTP long-polling and Websocket

Supported Engine Version
4.3
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
10 months ago
Git URL
Issue URL

Socket.IO Godot Client

This is a Socket.IO and Engine.IO client addon for Godot written in GDScript that supports both HTTP long-polling and Websocket.

This is still a work in progress and is not yet fully featured. Please make sure to check out the #features section before using it. The current implementation is functional and works, but there are some known cases that have not been implemented or covered yet (like binary messages)

Compatibility

Godot plugin version Socket.IO server
4.3 0.1.x 4.x

I haven’t checked the current implementation with older versions of the Godot and Socket.IO server. I hereby ask you to do this and inform me if it works or not.

Quickstart

Add the Socket.IO node to your tree and fill out the parameters in the Inspector, connect the signals via code or IDE, and use it.

@onready var client: SocketIO = $SocketIO

func _ready() -> void:
    client.socket_connected.connect(_on_socket_connected)
    client.event_received.connect(_on_event_received)

func _on_connect_pressed() -> void:
    client.make_connection()

func func _on_socket_connected() -> void:
    client.emit("hello")
    client.emit("some_event", { "value": 10 })

func _on_event_received(event: String, data: Variant, ns: String) -> void:
    print("event %s with %s as data received" % [event, data])

Features

Name Status Description
HTTP long-polling βœ”οΈ
Websocket βœ”οΈ
WebTransport ❌ requires: Add support for WebTransport in Godot
auto upgrade βœ”οΈ
emit events βœ”οΈ
listen to events βœ”οΈ
namespaces βœ”οΈ Multiplexing
custom path βœ”οΈ
auth βœ”οΈ
automatic reconnection ❌ reconnection attempts, delay, factor
connection timeout ❌ if the client does not receive a ping packet within pingInterval + pingTimeout, then it SHOULD consider that the connection is closed (link)
query ❌ additional query parameters that are sent when connecting a namespace socket.handshake.query
extra headers ❌
emit with acknowledgement ❌ acknowledgement
Websocket only ❌ connect to Websocket only (disable polling)
binary messages ❌
noop packet ❌
error handling for HTTP requests ❌ inside request.gd
custom serializer ❌ Custom parser
C# API ❌

License

MIT

Socket.IO and Engine.IO client addon that supports both HTTP long-polling and Websocket

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Socket.IO icon image
msabaeian
Socket.IO

Socket.IO and Engine.IO client addon that supports both HTTP long-polling and Websocket

Supported Engine Version
4.3
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
10 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers