sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

WebSocket Server - ERR: The IP Address of the host is not a local IP Address - SipSorcery WebRTC Receiver

Open sanskar-singh-rajput opened this issue 4 years ago • 6 comments

In SipSorcery's WebRTCViewer, when running the application on the localhost, all seems fine. However when I try to switch to a non-local wss address, I tend to get the following error

Exception Unhandled: SystemAugmentException 'The host part could not be converted to an IP address. (Parameter 'url')'

Referencing code: https://github.com/sipsorcery-org/sipsorcery/tree/master/examples/WebRTCExamples/WebRTCReceiver

The only part replaced in the code is wss and stun address strings in program.cs. The addresses belong to a live server streaming through Amazon Kinesis. Capture

sanskar-singh-rajput avatar Sep 15 '21 04:09 sanskar-singh-rajput

The address in the WebSocketServer constructor is the address you want to listen on and not the one you want to connect to.

If you want to connect to your web socket server from the Internet you'll need to make sure your firewall(s) allow it and that if you're using IPv4 you've set up a NAT forward. If you have a public IPv6 address that makes things a lot easier.

sipsorcery avatar Sep 15 '21 19:09 sipsorcery

Thanks for your response, very much appreciated.

I understood that I'll need to provide the address of my own system in order to actively listen on it. I've configured my Adapter settings to use only ipv6 address. And starting the application from cmd WebRTCReceiver --ipv6=24**:40**:20**:fb**:95**:e2**:ed**:d9** starts the winform too.

But I still don't know the ws/wss address its listening on. In the cmd output it says Waiting for web socket connections on ws://:::8081.... Wouldn't I need this address specified in the host/master. Capture

sanskar-singh-rajput avatar Sep 15 '21 22:09 sanskar-singh-rajput

You would attempt to connect to your machine using:

ws://[24**:40**:20**:fb**:95**:e2**:ed**:d9**]:8081

sipsorcery avatar Sep 16 '21 07:09 sipsorcery

Thanks, I was missing the square brackets, that did the trick.

But I was wondering, if there was a way to integrate Amazon Kinesis Webrtc Video Streaming Service with the sipsorcery receiver. I am provided a wss endpoint for master and viewer both from kinesis. Along with the wss endpoint, I also have a https endpoint , stun and turn urls. However, I was unable to find a way to establish a connection from kinesis to sipsorcery receiver.

sanskar-singh-rajput avatar Sep 16 '21 15:09 sanskar-singh-rajput

I don't think it's that straight forward to integrate with Amazon's Kinesis. I took a quick look a while ago and it seems the signalling to set up the WebRTC session required the use of their SDK. I only had a very quick look though so could be wrong.

Your best bet would be to try and find another open source project that has intgegrated with Kinesis and use or copy that. Pion WebRTC would be worth checking.

sipsorcery avatar Sep 16 '21 15:09 sipsorcery

Thanks a lot for your assistance, it helped me a lot with my project and I really appreciate it. Another thing that I encountered while doing my tests was weird numbers when considering latency over different devices.

Another last thing that I wanted to clarify was does webrtc depend on how far the streamer and the receiver are located? How does this affect SipSorcery WebRTC Receiver, if it does at all?

sanskar-singh-rajput avatar Oct 18 '21 22:10 sanskar-singh-rajput