extends Node onready var client = $WebSocketClient var sent = false func _ready(): client.sock_connect_to_url("ws://127.0.0.1:8181") func _process(_delta): if client.state == 2 and not sent: client.send("test string".to_utf8(), true) client.send(JSON.print({"items" : [1, "test_dictionary"]}).to_utf8(), true) sent = true if client.state == 2: var message = client.receive() if message: print(message)