snsinfu / reverse-tunnel

Reverse tunnel TCP and UDP
MIT License
178 stars 38 forks source link

https/wss #4

Closed peterWab closed 5 years ago

peterWab commented 5 years ago

hi when the server is behind caddy https agent fails to connect when i set the yml to wss help please.

snsinfu commented 5 years ago

Thanks for the report! It can be a config issue. How do your config files (agent, server and caddy) look like? Maybe you are setting gateway_url port number to 9000 in your rtun.yml. When using Caddy the port number should be changed to 443 or left default (so the agent connects to Caddy).

For reference, the following is my Caddyfile which is working:

example.com {
    proxy /v1 http://localhost:9000 {
        without /v1
        websocket
    }
    tls snsinfu@example.com
}

The rtun-server config looks like this:

# rtun-server.yml
control_address: localhost:9000
agents:
  ...

And this is agent config:

# rtun.yml
gateway_url: wss://example.com/v1
auth_key: ...
peterWab commented 5 years ago

thanx