Skip to content

session: default https-proxy option to the same as http-proxy #2536

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

Merged
merged 2 commits into from
Jul 21, 2019

Conversation

beardypig
Copy link
Member

This sets the default value of https-proxy to same as http-proxy, it can be overridden still by setting https-proxy.

@beardypig
Copy link
Member Author

Should we deprecate the --https-proxy option? For comparison, cURL only supports a single --proxy option via the command line, I don't know if the environment variables HTTP_PROXY and HTTPS_PROXY still work independently though...

@beardypig beardypig force-pushed the https-proxy-default branch from 30fe54d to 57e5ba3 Compare July 9, 2019 11:04
@codecov
Copy link

codecov bot commented Jul 9, 2019

Codecov Report

Merging #2536 into master will decrease coverage by 0.27%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #2536      +/-   ##
==========================================
- Coverage   52.56%   52.29%   -0.28%     
==========================================
  Files         239      239              
  Lines       15118    15120       +2     
==========================================
- Hits         7947     7907      -40     
- Misses       7171     7213      +42

@codecov
Copy link

codecov bot commented Jul 9, 2019

Codecov Report

Merging #2536 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2536      +/-   ##
==========================================
+ Coverage   52.54%   52.56%   +0.01%     
==========================================
  Files         239      239              
  Lines       15131    15133       +2     
==========================================
+ Hits         7950     7954       +4     
+ Misses       7181     7179       -2

@gravyboat
Copy link
Member

gravyboat commented Jul 11, 2019

If we deprecate the old one we'll have to do a full dot release instead of an incremental. I don't have an issue with it if you want to go that way, but I don't think it's really needed here and don't see a reason not to support both options. As long as it's noted in the code (and docs) that they operate in the same way and it exists for legacy support purposes. It needs to be clear to people just in case they try to set both so they won't waste time as that's a personal pet peeve of mine on open source projects that don't properly notate changes like this.

@beardypig
Copy link
Member Author

Sounds good. I'm happy with the PR as is then. Unless you think there should be more in the docs to highlight it?

@gravyboat
Copy link
Member

gravyboat commented Jul 11, 2019

@beardypig Should a note be added to --https-proxy noting that you can only have one of them? It's a pretty minor edge case, but if someone had settings for both and one was overwritten that could be confusing.

@beardypig
Copy link
Member Author

Setting --https-proxy will still have the desired effect - it will set the proxy for https, but the default value will be the same as the proxy for http. http-proxy set the https proxy if it is not already set, and https-proxy sets it regardless.

Lemme add some tests ... :)

@back-to
Copy link
Collaborator

back-to commented Jul 13, 2019

Should we deprecate the --https-proxy option?

--https-proxy should probably be hidden on https://streamlink.github.io/latest/cli.html
so people should start using only --http-proxy

@beardypig
Copy link
Member Author

Would we hide the option, but still have it function as it did? I think changing the help text to argparse.SUPPRESS would do that, the question is: is being able to set a separate https proxy useful? I’ve never found it useful...

@back-to
Copy link
Collaborator

back-to commented Jul 13, 2019

gravyboat: If we deprecate the old one we'll have to do a full dot release instead of an incremental.

maybe it could be unified to one command

so this won't happen for some user scripts

streamlink: error: unrecognized arguments: --https-proxy

gravyboat: I don't think it's really needed here and don't see a reason not to support both options.

it is most of the time annoying to enter the same proxy with two commands,
I see this as a cleanup for streamlink.

beardypig: is being able to set a separate https proxy useful?

99% of the time not really

beardypig: I think changing the help text to argparse.SUPPRESS

if there should be two commands, this would be an option

@beardypig
Copy link
Member Author

True, the other option is to make https-proxy an alias of http-proxy.

@back-to
Copy link
Collaborator

back-to commented Jul 13, 2019

or a new command --proxy and --http-proxy / --https-proxy as alias

@beardypig
Copy link
Member Author

I think --http-proxy fits better with the other options for http, there might be proxies for other things - do we still support rtmp? :)

@gravyboat
Copy link
Member

Restarted the Travis build since it didn't report in for some reason even though it succeeded.

@beardypig
Copy link
Member Author

My preference is as the PR is now, we don't lose any functionality but it makes it easier for users because you don't have to set both proxies.

@gravyboat
Copy link
Member

Broken thanks to some Travis changes. I've installed the Travis CI app for the org but I've only activated it on the main repo. @bastimeyer @beardypig @back-to just a heads up that I've done this in case you get an email about it.

I'm restarting the Travis build again in hopes that the check notated in that linked document will show up correctly in the branches interface because right now it's not there at all.

@beardypig beardypig force-pushed the https-proxy-default branch from ea9e831 to 50cfdec Compare July 13, 2019 22:12
@beardypig beardypig force-pushed the https-proxy-default branch from 50cfdec to fb5cbe2 Compare July 20, 2019 09:48
@back-to back-to merged commit f7fd0db into streamlink:master Jul 21, 2019
mkbloke pushed a commit to mkbloke/streamlink that referenced this pull request Aug 18, 2020
session: default https-proxy option to the same as http-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants