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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.