Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web socket support for webrtc signaling server #3467

Open
TimoKettunen opened this issue Jun 14, 2024 · 7 comments
Open

Web socket support for webrtc signaling server #3467

TimoKettunen opened this issue Jun 14, 2024 · 7 comments
Labels
question Further information is requested

Comments

@TimoKettunen
Copy link

Describe the feature

Mediamtx integrates the webrtc signaling server but it supports only HTTP.
Some clients work only with web socket interface for signaling server.
Mediamtx should support also web socket interface for signaling server.

@pikachu937
Copy link

Describe the feature

Mediamtx integrates the webrtc signaling server but it supports only HTTP. Some clients work only with web socket interface for signaling server. Mediamtx should support also web socket interface for signaling server.

it would be great

@acris5
Copy link

acris5 commented Jun 19, 2024

I also need it

@aler9 aler9 added the question Further information is requested label Jun 19, 2024
@aler9
Copy link
Member

aler9 commented Jun 19, 2024

Hello, WebSocket is a generic communication protocol like HTTP - in order to perform signaling, there must be a specification that describes how messages are formatted and what's their order.

Is anyone able to provide a document or a reference implementation that describes how to perform "signaling with WebSocket"? otherwise there are 2^N possible implementations, where N is a really big number. That's why WHIP / WHEP was standardized.

@pikachu937
Copy link

Is anyone able to provide a document or a reference implementation that describes how to perform "signaling with WebSocket"?

please explain what does the specification have to do with it? in version 0.21.0 dated December 20, 2022, there was an implementation with websockets; in version 0.21.1 dated January 9, 2023, certain changes were made thanks to which webrtc began to work great. that is, in fact it WORKED

in version 1.0.0 you changed the technology and now there is only whep for watching broadcasts, but not everyone (especially mobile platforms) can work with it normally, but everyone knows how to work with webrtc via websockets perfectly

@aler9
Copy link
Member

aler9 commented Jun 19, 2024

@pikachu937 that signaling implementation worked with a non-standardized procedure that was more or less like this:

  1. a client connects through WebSocket to the server, without sending anything other than the initial WebSocket handshake
  2. server sends ICE servers in raw JSON
  3. server sends a SDP offer in raw SDP
  4. client replies with a SDP answer in raw SDP
  5. server sends any asynchronous ICE candidate in a custom JSON format
  6. client sends any asynchronous ICE candidate in a custom JSON format

The order and the format of each step is completely arbitrary and i'm pretty sure that there were no client libraries that worked in the same way. Are you able to provide a list of libraries that support the steps and order described above?

@TimoKettunen
Copy link
Author

My original motivation was to have signaling work with Unity Render Streaming. WHEP is great and it is draft standard, unfortunately not supported by Unity. When I studied more, I understood that there is no standard way to do traditional webRTC signaling with HTTP or WebSocket. Unity made it one way and provided sample signaling server that implemented it. But the Chrome web browser was able to use it. Same thing with RTSPtoWebRTC, it implemented signaling bit differently and still browser was able to connect. So even there is no standard, browser code can handle different signaling methods. This feature request could be updated to "support traditional webRTC signaling that is compatible with browsers, Unity and ...(wish list)".

@pikachu937
Copy link

@pikachu937 that signaling implementation worked with a non-standardized procedure that was more or less like this:

  1. a client connects through WebSocket to the server, without sending anything other than the initial WebSocket handshake
  2. server sends ICE servers in raw JSON
  3. server sends a SDP offer in raw SDP
  4. client replies with a SDP answer in raw SDP
  5. server sends any asynchronous ICE candidate in a custom JSON format
  6. client sends any asynchronous ICE candidate in a custom JSON format

The order and the format of each step is completely arbitrary and i'm pretty sure that there were no client libraries that worked in the same way. Are you able to provide a list of libraries that support the steps and order described above?

I can’t provide libraries, but I can check all versions of mediamtx (at that time it was still rtsp-simple-server) in which you had webrtc running via websocket with mobile platforms (ios/android) with their different possible implementations of ws/wss clients to check functionality . If necessary, I can provide logs so that you can use them to understand how the connection from them occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants