datarhei / gosrt

Implementation of the SRT protocol in pure Go
https://datarhei.com
MIT License
114 stars 17 forks source link

No way to get URL parameters from connRequest #6

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi,

it looks like something is broken, there is no way to retrieve the url parameters (like the token) from the connRequest.

The server contrib example uses streamId for this but all chars after the next & are stripped.

Thanks

ioppermann commented 1 year ago

The streamid is a query parameter, i.e. the value of the streamid parameter has to be URL-encoded. If your streamid contains a & you have to encode it as %26.

All other query parameter are for configuring the SRT connection. Everything that is specific to your application has to be part of the streamid.

ghost commented 1 year ago

Hi, thanks for this fast answer!

Of course it is, I should ave thought about it... sorry I know it's not related to gosrt implementation, but what would the best way to put auth in place with srt then ? It's not very convenient to put a "%26" in the url... Thank again

ioppermann commented 1 year ago

In the streamid you're free to use any format for the information you want to transport. This means that you could use different separators that don't require URL encoding, e.g. streamid=token:qwertz,resource=foobar.

ghost commented 1 year ago

Understood thank you very much!