Proposal: Change st2client defaults to bypass proxy for localhost
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
When executing st2 <x> commands, st2client will inherit the environment's proxy settings. This is a good thing if you happen to be running those commands from a separate system, and you need to go via a proxy to reach the ST2 server.
But if you are running those commands on the ST2 server itself, then st2client is connecting to URLs like http://127.0.0.1:9100/tokens. If you have a proxy configured, you will get an error message like:
Failed to log in as USERID: 403 Client Error: Forbidden
Unable to retrieve detailed message from the HTTP response. Expecting value: line 1 column 1 (char 0)
for url: http://127.0.0.1:9100/tokens
This is very confusing for users. The problem is that st2client is making a request to the proxy server for 127.0.0.1. This is never going to work. There is no way a proxy can ever work for connections to loopback.
Our current advice to users is to tell them to configure export no_proxy=localhost,127.0.0.1. That works, but it is annoying.
Proposal: Change the defaults so we always bypass the proxy when connecting to localhost or 127.0.0.1. This will reduce confusion, and reduce support issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the st2client code used by st2 <x> commands to construct HTTP requests and apply proxy settings. Check how connections to localhost and 127.0.0.1 are handled, then identify or add relevant tests showing that proxy use is bypassed for loopback URLs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100