eriksl / streamproxy

This stream proxy can replace the streamproxy, transtreamproxy and filestreamproxy on VU+ receiver. Care has been taken to always fetch all bufferend data, so the transcoding engine won't crash.
Other
11 stars 14 forks source link

Streamproxy may use config.OpenWebif.auth_for_streaming #6

Closed anudanan closed 5 years ago

anudanan commented 5 years ago

I have a little feature request for authentication of http transcoding streaming with streamproxy

When a user makes the openwebif config with HTTP auth true and HTTP streaming without auth, than streamproxy makes http streaming with auth instead of without auth. Streamproxy only shows the parameter config.OpenWebif.auth.

So I think it would be a better idea for streamproxy to show not only on Config.OpenWebIf.auth value, because there is a second Parameter config.OpenWebif.auth_for_streaming (default is false) which can be false also if OpenWebif.auth is true. Then a user can set auth for normal http openwebif and can user streaming without auth also for transcoding

eriksl commented 5 years ago

I have difficulty onderstanding this. Do you mean OWIF has a new parameter? What does it do?

anudanan commented 5 years ago

Yes, it is a parameter for openwebif which comes up if http auth is true, then you can set http streaming with or without auth

eriksl commented 5 years ago

I still don't understand. I am not familiar with all inside stuff of OWIF. What-does-it-do!?

Beware that if enigma has been configured for authentication on streaming, streamproxy MUST also use authentication, it's a consequence of how it's implememented in enigma.

anudanan commented 5 years ago

The OWIF has two parameters for http authentication

In streamproxy.cpp

instead of

  if(settings.exists("config.OpenWebif.auth"))
      if(settings.as_string("config.OpenWebif.auth") == "true")
          config_map["auth"] = ConfigValue(true);
      else
          config_map["auth"] = ConfigValue(option_webifauth);
  else
      config_map["auth"] = ConfigValue(option_webifauth);

take

  if(settings.exists("config.OpenWebif.auth"))
      if(settings.as_string("config.OpenWebif.auth") == "true")
          if(settings.as_string(config.OpenWebif.auth_for_streaming") == "true")
              config_map["auth"] = ConfigValue(true);
  else
      config_map["auth"] = ConfigValue(option_webifauth);

An other idea is to set the streamproxy auth identical to the streaming authentication parameter in the enigma settings

config.streaming.authentication

Do you know which parameter is used for http streaming to port 8001? The enigma parameter config.streaming.authentication or the openWBIF parameter config.OpenWebif.auth_for_streaming

I think one of both parameter (config.streaming.authentication oder config.OpenWebif.auth_for_streaming) is better than only use the OpenWebif.auth parameter for streamproxy. It depends on your idea if a user configure streamproxy auth with OWIF parameter or enigma parameter

anudanan commented 5 years ago

It is now in the repo