[GH-ISSUE #506] Terminal CLI requests not shown, even if HTTP_PROXY is set #503

Open
opened 2026-03-03 19:19:22 +03:00 by kerem · 6 comments
Owner

Originally created by @alexpreynolds on GitHub (May 18, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/506

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

1.23.0

macOS Version? (Ex. mac 10.14)

10.15.4

Steps to reproduce

  1. Open Terminal
  2. Set HTTP_PROXY environment variable
  3. Check output from env to confirm environment is set correctly
  4. Run a command-line tool that makes an HTTP request (e.g., tabix)

As an example command:

$ HTTP_PROXY=http://127.0.0.1:9090 
$ env | grep HTTP_PROXY
HTTP_PROXY=http://127.0.0.1:9090
$ tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78643943
...

Other tools also do not seem to work (e.g. curl):

$ HTTP_PROXY=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi

I do know that one can manually set the proxy in curl with the -x option. However, I'm trying to demonstrate that HTTP_PROXY appears not to work with Proxyman for generic CLI operations.

Expected behavior

When HTTP_PROXY is set, I would expect to see the details of this and other HTTP requests in Proxyman made with CLI tools.

Screenshots (optional)

Originally created by @alexpreynolds on GitHub (May 18, 2020). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/506 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) 1.23.0 ### macOS Version? (Ex. mac 10.14) 10.15.4 ### Steps to reproduce 1. Open Terminal 2. Set `HTTP_PROXY` environment variable 3. Check output from `env` to confirm environment is set correctly 3. Run a command-line tool that makes an HTTP request (e.g., [`tabix`](https://github.com/samtools/tabix)) As an example command: ``` $ HTTP_PROXY=http://127.0.0.1:9090 $ env | grep HTTP_PROXY HTTP_PROXY=http://127.0.0.1:9090 $ tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78643943 ... ``` Other tools also do not seem to work (e.g. `curl`): ``` $ HTTP_PROXY=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi ``` I do know that one can manually set the proxy in `curl` with the `-x` option. However, I'm trying to demonstrate that `HTTP_PROXY` appears not to work with Proxyman for generic CLI operations. ### Expected behavior When `HTTP_PROXY` is set, I would expect to see the details of this and other HTTP requests in Proxyman made with CLI tools. ### Screenshots (optional)
Author
Owner

@NghiaTranUIT commented on GitHub (May 19, 2020):

Hey @alexpreynolds, HTTP_PROXY (uppercase) won't work with curl (http_proxy=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi)

Let try to lowercase version, it will work 👍

http_proxy=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi

Alternatively, you can force by using the flag --proxy http://localhost:9090
For instance,

curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi --proxy http://localhost:9090 -o /tmp/foo.tbi

The request will appear on Proxyman

Screen Shot 2020-05-19 at 09 36 22
<!-- gh-comment-id:630543564 --> @NghiaTranUIT commented on GitHub (May 19, 2020): Hey @alexpreynolds, `HTTP_PROXY` (uppercase) won't work with curl (http_proxy=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi) Let try to lowercase version, it will work 👍 ``` http_proxy=http://127.0.0.1:9090 curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi -o /tmp/foo.tbi ``` Alternatively, you can force by using the flag `--proxy http://localhost:9090` For instance, ``` curl http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi --proxy http://localhost:9090 -o /tmp/foo.tbi ``` The request will appear on Proxyman <img width="1445" alt="Screen Shot 2020-05-19 at 09 36 22" src="https://user-images.githubusercontent.com/5878421/82278363-388ab980-99b4-11ea-88d2-4e15d7529cd1.png">
Author
Owner

@alexpreynolds commented on GitHub (May 20, 2020):

Thanks, I was able to make some progress.

However, I still get errors and am unable to investigate the response data.

Here's an example of an unproxied request:

$ tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78459200
chr5	78459000	78459200	0	0	0	0	-0.03079	0	0	0	0	0	0	0	0	-0.04324	0.5092

Here's an example of the equivalent request, proxied through Proxyman:

$ http_proxy=http://127.0.0.1:9090 tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78459200

The proxied request takes a long time but does goes through.

However, I get errors within Proxyman:

Screen Shot 2020-05-20 at 1 35 45 PM

The error at the bottom is Protocol wrong type for socket (code=41).

There are two requests from one call to tabix, in this case, because tabix first requests data from http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi, in order to find out what byte range to request from http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.

My goal with Proxyman is to investigate these two requests and their respective responses.

<!-- gh-comment-id:631714824 --> @alexpreynolds commented on GitHub (May 20, 2020): Thanks, I was able to make some progress. However, I still get errors and am unable to investigate the response data. Here's an example of an unproxied request: ``` $ tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78459200 chr5 78459000 78459200 0 0 0 0 -0.03079 0 0 0 0 0 0 0 0 -0.04324 0.5092 ``` Here's an example of the equivalent request, proxied through Proxyman: ``` $ http_proxy=http://127.0.0.1:9090 tabix http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz chr5:78459198-78459200 ``` The proxied request takes a long time but does goes through. However, I get errors within Proxyman: <img width="1538" alt="Screen Shot 2020-05-20 at 1 35 45 PM" src="https://user-images.githubusercontent.com/33584/82494718-dc509400-9a9e-11ea-9284-767b7956c312.png"> The error at the bottom is `Protocol wrong type for socket (code=41)`. There are two requests from one call to `tabix`, in this case, because `tabix` first requests data from `http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz.tbi`, in order to find out what byte range to request from `http://explore.altius.org/tabix/vA/hg19.15.all.KL.gz`. My goal with Proxyman is to investigate these two requests and their respective responses.
Author
Owner

@alexpreynolds commented on GitHub (May 20, 2020):

Interestingly, on a subsequent run, I get a Broken pipe (code=32) error:

Screen Shot 2020-05-20 at 1 44 55 PM
<!-- gh-comment-id:631717512 --> @alexpreynolds commented on GitHub (May 20, 2020): Interestingly, on a subsequent run, I get a `Broken pipe (code=32)` error: <img width="1538" alt="Screen Shot 2020-05-20 at 1 44 55 PM" src="https://user-images.githubusercontent.com/33584/82495582-2a19cc00-9aa0-11ea-9a0b-1b41a7da7cad.png">
Author
Owner

@NghiaTranUIT commented on GitHub (May 21, 2020):

Hey @alexpreynolds, I found the bug. Technically, the Socket returns an error even though the response is received and constructed properly, so Proxyman presents the error instead of the real Response.

Let check this BETA build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_1.23.0_Fix_Proxy_Big_Files.dmg

It takes a long time because the large files are transferring to Proxyman's proxy (>100Mb)

Screen Shot 2020-05-21 at 09 48 07

You can export the Body for further investigations by Right-Click -> Export -> Response Body

<!-- gh-comment-id:631852685 --> @NghiaTranUIT commented on GitHub (May 21, 2020): Hey @alexpreynolds, I found the bug. Technically, the Socket returns an error even though the response is received and constructed properly, so Proxyman presents the error instead of the real Response. Let check this BETA build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_1.23.0_Fix_Proxy_Big_Files.dmg It takes a long time because the large files are transferring to Proxyman's proxy (>100Mb) <img width="2237" alt="Screen Shot 2020-05-21 at 09 48 07" src="https://user-images.githubusercontent.com/5878421/82519068-fcd62800-9b4a-11ea-9e87-c86bd3a52faf.png"> You can export the Body for further investigations by Right-Click -> Export -> Response Body
Author
Owner

@alexpreynolds commented on GitHub (May 26, 2020):

Thanks for your help — I now get back a fair bit of data and no errors, which I'm parsing through. Assuming I run this on different datasets and run into larger datasets being transferred, is there a static upper limit on data set in this beta, or is this a variable that can be set on running Proxyman (via environment variable or some preference within Proxyman)?

<!-- gh-comment-id:634318305 --> @alexpreynolds commented on GitHub (May 26, 2020): Thanks for your help — I now get back a fair bit of data and no errors, which I'm parsing through. Assuming I run this on different datasets and run into larger datasets being transferred, is there a static upper limit on data set in this beta, or is this a variable that can be set on running Proxyman (via environment variable or some preference within Proxyman)?
Author
Owner

@NghiaTranUIT commented on GitHub (May 28, 2020):

Unfortunately, there is no such upper limit feature at the moment. I will consider to add it later 👍

<!-- gh-comment-id:635091086 --> @NghiaTranUIT commented on GitHub (May 28, 2020): Unfortunately, there is no such upper limit feature at the moment. I will consider to add it later 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#503
No description provided.