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

Allow use of DNS resolution from proxy server #288

Open
bvanelli opened this issue Sep 20, 2023 · 1 comment
Open

Allow use of DNS resolution from proxy server #288

bvanelli opened this issue Sep 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@bvanelli
Copy link

Feature Proposed

Currently, you can connect through an HTTP proxy using the following config:

[client.transport]
type = "tcp"
[client.transport.tcp]
proxy = "http://proxy:3128"

But this only works if the domain name can be resolved by the host, not by the proxy. When setting the docker-compose with the extra host, it then works:

  bridge:
    # image: rapiz1/rathole:latest
    build: rathole/
    restart: always
    networks: ["edge"]
    container_name: bridge
    command: /app/config.toml
    extra_hosts: ["tunnel:172.19.0.3"]
    volumes:
      - "./rathole/application.toml:/app/config.toml"
    ports:
      - "8080:8080"

Since it's a PoC I fixed the internal IP.

Use Case

When the proxy is desired, but DNS resolution also has to go throught the proxy.

Possible Solution

I believe the proxy library in use is https://github.com/LinkTed/async-http-proxy, and therefore does not implement this feature of proxying dns requests. The general behaviour would be:

  • Add option proxy_dns = auto (default), local or proxy
  • When on automatic, try to resolve locally, if fails, try to resolve on proxy server
  • When on local, only use local dns resolution (current behaviour)
  • When on proxy, only use proxy dns resolution

My Rust knowlege is very limited but it seems like the type of feature I could implement, if you say it's feasible using currently libraries and no major refactor is required.

@bvanelli bvanelli added the enhancement New feature or request label Sep 20, 2023
@fernvenue
Copy link
Contributor

Yea, socks5h from curl is a great example.

@bvanelli bvanelli changed the title Allow use of DNS reolution from proxy server Allow use of DNS resolution from proxy server Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants