Nexmo / wsbridge

Other
26 stars 18 forks source link

[OPENTOK-46374] Custom headers not being received in Secure WS #13

Closed brunorib closed 2 years ago

brunorib commented 2 years ago

When using ssl, we lock the WebSocket client connection establishment with globals.mutex, then on channel init at the beginning we lock also with globals.mutex to increase the counter for the number of calls and after that we modify the first message. Since it's being locked only for WSS the channel init logic for adding the headers is not being done in proper timing (The lock can only be acquired once websocket is established).

Fix: change locking to be done after the object is modified.

csiwek commented 2 years ago

Are you guys using this code again? :-)

csiwek commented 2 years ago

you know there is a better version in internal repos? @odivorra ;-)