mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
fix: update Godot websocket handshake API
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
class_name ControlPlaneClient
|
||||
extends Node
|
||||
|
||||
# Authenticated HTTP boundary for matchmaking. ENet/Steam carries the match
|
||||
@@ -92,7 +91,11 @@ func connect_event_stream() -> Error:
|
||||
return ERR_UNAUTHORIZED
|
||||
var socket_url := websocket_url(base_url) + "/v1/events"
|
||||
_websocket = WebSocketPeer.new()
|
||||
var err := _websocket.connect_to_url(socket_url, PackedStringArray(["Authorization: Bearer " + access_token]))
|
||||
# Godot 4.7 moved handshake headers onto WebSocketPeer; the second
|
||||
# connect_to_url argument is TLSOptions, not an HTTP header array. Keep the
|
||||
# bearer token in the authenticated handshake without putting it in the URL.
|
||||
_websocket.handshake_headers = PackedStringArray(["Authorization: Bearer " + access_token])
|
||||
var err := _websocket.connect_to_url(socket_url)
|
||||
if err != OK:
|
||||
_set_websocket_status("DISCONNECTED")
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user