USAMAWIZARD / AntMedia-Gstreamer-Webrtc

sending and receiving Audio Video streams from Antmedia Using Gstreamer
2 stars 2 forks source link

Support for TLS / wss:// #4

Open ajlennon opened 5 months ago

ajlennon commented 5 months ago

Hi @USAMAWIZARD

We want to be able to support secure comms. for A/V streams and it looks like the librws only supports basic websockets (might be wrong here). If so then I might want to have a look at using some other websockets library that would allow us to use secure websockets. And obviously would want to contribute this back to the example here.

So I'm just asking - can this example already support secure websockets or what would you advise as the best route for me to add this in?

Thanks!

Alex

USAMAWIZARD commented 5 months ago

Hi @ajlennon , Yes you are correct , when I was looking for a websocket library to implement this project I saw this library ( librws ) which is cross os compatible and supports different CPUs so decided to go with it but after the implementation I found out that the library does not support WSS , I had planed to migrate it to a different library ( libsoup ) ( which is more mature and supports both wss and ws ) , libsoup would be good to migrate in this case or let me know if you find any other library.

note the WebRTC connection is secure by default because it used DTLS for the communication. web socket part is insecure which is used to communicate the SDP information. ( so the audio video is encrypted and SDP which contains information like IP supported encoding etc... is exposed over network when using ws but the actual audio video is encrypted )

ajlennon commented 5 months ago

That is really helpful thanks @USAMAWIZARD. So I've been looking at libwebsockets as it's in OpenIPC and seems fairly standard but it looks really pretty complicated. I'll go and have a look at libsoup then!

Also the info about DTLS versus websockets is really good to know too thanks

ajlennon commented 5 months ago

I like the look of this. Seems more straightforward than libwebsockets and I like that it is based on glib so should integrate nicely with gstreamer

https://github.com/david7482/libsoup_websocket_client/blob/master/websocket_client.c