0
\$\begingroup\$

How to pass custom header information on a Godot4 WebSocketPeer connection?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Okay, I have found how to do this:

  1. Create an instance of PackedStringArray
  2. Add it to the WS Client using _set_handshake_headers

Example:

var _connHeader = PackedStringArray(["header-key: header-value"])
_mySocket.set_handshake_headers(_connHeader)
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .