Skip to content
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

Forward Traffic to Another HTTP Proxy #324

Closed
CorrM opened this issue Jul 28, 2024 · 8 comments
Closed

Forward Traffic to Another HTTP Proxy #324

CorrM opened this issue Jul 28, 2024 · 8 comments

Comments

@CorrM
Copy link
Contributor

CorrM commented Jul 28, 2024

Describe the goal

I am trying to use wstunnel to forward traffic from my local machine to an external HTTP proxy that requires a username and password for authentication. My goal is to have my local machine connect to a VPS via wstunnel, and then have wstunnel on the VPS forward the traffic to the external HTTP proxy.

Maybe something like that but for server:

-p, --http-proxy <USER:PASS@HOST:PORT>
          If set, will use this http proxy to connect to the server [env: HTTP_PROXY=]
      --http-proxy-login <LOGIN>
          If set, will use this login to connect to the http proxy. Override the one from --http-proxy [env: WSTUNNEL_HTTP_PROXY_LOGIN=]
      --http-proxy-password <PASSWORD>
          If set, will use this password to connect to the http proxy. Override the one from --http-proxy [env: WSTUNNEL_HTTP_PROXY_PASSWORD=]

Describe what does not work

wstunnel doesn't respect http_proxy env variable

Describe your wstunnel setup

Client:

wstunnel client -L socks5://127.0.0.1:8888 --connection-min-idle 5 wss://<VPS_IP>:8080

Server:

#!/bin/bash

export http_proxy=http://<USER>:<PASS>@<PROXY_IP>:<PROXY_PORT>
export https_proxy=http://<USER>:<PASS>@<PROXY_IP>:<PROXY_PORT>

wstunnel server wss://[::]:8080

Desktop

  • OS: Linux Ubuntu x86_64
  • Version: 6.8.0-38-generic
Copy link

Hello @CorrM 👋

This issue is being automatically closed because it does not follow the issue template.

@CorrM
Copy link
Contributor Author

CorrM commented Jul 28, 2024

@erebe

@erebe
Copy link
Owner

erebe commented Jul 28, 2024

Indeed,
At the moment, the server does not handle using another http proxy as relay.
I keep the feature open and will see when I have time to implement it.

For now, I am working of adding the client to starting a http proxy localy to forward traffic.

@CorrM
Copy link
Contributor Author

CorrM commented Jul 28, 2024

For now, I am working of adding the client to starting a http proxy localy to forward traffic.

Thats what client -p do right?

@erebe
Copy link
Owner

erebe commented Jul 28, 2024

More a new local and remote listener that is an http proxy

  -L, --local-to-remote <{tcp,udp,socks5,stdio,unix}://[BIND:]PORT:HOST:PORT>
          Listen on local and forwards traffic from remote. Can be specified multiple times
          examples:
          'tcp://1212:google.com:443'      =>       listen locally on tcp on port 1212 and forward to google.com on port 443
          'tcp://2:n.lan:4?proxy_protocol' =>       listen locally on tcp on port 2 and forward to n.lan on port 4
                                                    Send a proxy protocol header v2 when establishing connection to n.lan

          'udp://1212:1.1.1.1:53'          =>       listen locally on udp on port 1212 and forward to cloudflare dns 1.1.1.1 on port 53
          'udp://1212:1.1.1.1:53?timeout_sec=10'    timeout_sec on udp force close the tunnel after 10sec. Set it to 0 to disable the timeout [default: 30]

          'socks5://[::1]:1212'            =>       listen locally with socks5 on port 1212 and forward dynamically requested tunnel
          'socks5://[::1]:1212?login=admin&password=admin' => listen locally with socks5 on port 1212 and only accept connection with login=admin and password=admin

          'http://[::1]:1212'              =>       start a http proxy on port 1212 and forward dynamically requested tunnel
          'http://[::1]:1212?login=admin&password=admin' => start a http proxy on port 1212 and only accept connection with login=admin and password=admin

the last line in the quote

@CorrM
Copy link
Contributor Author

CorrM commented Jul 28, 2024

i will try read the code and if i though that i can contribute will send RP.

btw, nice work on the project <3.

if there a way we can talk, discord?

@erebe
Copy link
Owner

erebe commented Jul 28, 2024

Sure,
I am going for a run now, but I usually connected on rust programming language or tokio rust discord under the same username

@CorrM
Copy link
Contributor Author

CorrM commented Jul 28, 2024

Sure, I am going for a run now, but I usually connected on rust programming language or tokio rust discord under the same username

i cant add you in discord, my dicord are corrm add me

@CorrM CorrM changed the title Forward Traffic to Another HTTP Proxy with Authentication Using wstunnel Forward Traffic to Another HTTP Proxy Jul 30, 2024
@CorrM CorrM closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants