endel / NativeWebSocket

🔌 WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP)
Other
1.13k stars 155 forks source link

Headers are not working in WebGL build. #87

Closed DiscreteTom closed 10 months ago

DiscreteTom commented 10 months ago

I'm trying to add headers to the WebSocket request:

var websocket = new WebSocket(config.serverUrl, new() {
  {"Authorization", $"Bearer {config.authToken}"}
});

In WebGL build, the auth header is missing.

In the source code I see the header is not used.

https://github.com/endel/NativeWebSocket/blob/c5101c07762251edc82caad9e8a39d51b1229c31/WebSocket/WebSocket.cs#L232-L241

DiscreteTom commented 10 months ago

Duplicated with #14