Hi,
I'm implementing a webRTC client for a remote device. Successfully implemented all the pushkit+callkit part using inline OBJC.
Now I'm facin the problem that, in order to set-up the connection, I need to open a WebSocket, but as soon as I do it, it closes.
The problem seems to be that the remote device's webSocket uses Janus specific-subprotocol, and it must be specified in the headers when connecting
For reference, the working codes in other languages are
I can't figure out how to do it with the iWebSocket library. Perhaps there is some workaround with nativeObject? Otherwise I'll have to implement it with inline OBJC, but of course I'd like to avoid it.
I'm implementing a webRTC client for a remote device. Successfully implemented all the pushkit+callkit part using inline OBJC.
Now I'm facin the problem that, in order to set-up the connection, I need to open a WebSocket, but as soon as I do it, it closes.
The problem seems to be that the remote device's webSocket uses Janus specific-subprotocol, and it must be specified in the headers when connecting
For reference, the working codes in other languages are
B4X:
'React-Native partial code
const ws = new WebSocket( 'ws://xx.xx.xx.xx:pppp' , 'janus-protocol');
'Swift partial code
let url = URL(string: "ws://xx.xx.xx.xx:pppp)!
var request = URLRequest(url: url)
request.setValue("janus-protocol", forHTTPHeaderField: "Sec-WebSocket-Protocol")
let ws = URLSessionWebSocketTask(session: session, url: url)
I can't figure out how to do it with the iWebSocket library. Perhaps there is some workaround with nativeObject? Otherwise I'll have to implement it with inline OBJC, but of course I'd like to avoid it.