Grocel / 3D-Stream-Radio

It is an spawnable scripted entity for Garry's Mod that allows you to play online streams and local files as 3D world sound.
https://steamcommunity.com/sharedfiles/filedetails/?id=246756300
17 stars 4 forks source link

Add stream url whitelisting based on installed playlists #9

Closed Grocel closed 10 months ago

Grocel commented 2 years ago

When the convar sv_streamradio_allow_customurls set to 0 the radio does not accept any URL that has been manually inputted (wiremod, toolgun, dupe) into the radio. This is for security reasons.

Even when the URL is actually existing inside a playlist it would not play if it was not picked from the playlist view in the GUI. The goal of this change is that the URL no longer blocked in this case. So the playlist files are the server's whitelist so to speak.

It is however unclear if I will be able to implement this in the near feature.

Grocel commented 1 year ago

Could be implemented by third party addon CFC Client HTTP Whitelist. See https://github.com/CFC-Servers/cfc_cl_http_whitelist/issues/34

Peekofwar commented 11 months ago

Theoretically, you could parse all playlists at startup and add all URLs found to a whitelist, then check against that whitelist before fetching a file..

Grocel commented 11 months ago

Yes indeed, but there are some issues which makes it less simple.

  1. Not all playlist files reading/parsing is done asynchronous, making it difficult to know when all playlist are loaded. I would have to exclude the shoutcast auto playlist too. I have some ideas to get this working.
  2. I would implement asynchronous clientside checking function that asks the server if the URL was good or not.
  3. The list of all URLs is potentially very long, even when it is de-duplicated. This depends on how many URLs the server has. The list must be updated on playlist changes, addition or deletions. The list must be loaded on startup too. I have structure in mind that will get this rolling.

I am not sure when I will be able to get on this, though.

Grocel commented 10 months ago

This has been resolved with commit 57cb64a.