-
I tried tunneling ports Server: docker-compose.yml version: '3.8'
services:
rathole:
image: rapiz1/rathole:v0.5.0
command: --server /config/rathole.server.toml
restart: unless-stopped
ports:
- 2333:2333
- 80:5080
- 443:5443
# host:container
volumes:
- ./rathole.server.toml:/config/rathole.server.toml:ro rathole.server.toml [server]
bind_addr = "0.0.0.0:2333"
# I have tried both with and without Noise
# [server.transport]
# type = "noise"
# [server.transport.noise]
# local_private_key = "private_key"
[server.services.nginx-http]
token = "secret_token"
bind_addr = "0.0.0.0:5080" Client: docker-compose.yml version: '3.8'
services:
rathole:
image: rapiz1/rathole:v0.5.0
command: --client /config/rathole.client.toml
restart: unless-stopped
volumes:
- ./rathole.client.toml:/config/rathole.client.toml:ro
ports:
- '8080:5080'
networks:
- proxy
nginx-with-volume:
image: nginx:stable-alpine3.17-slim
container_name: nginx-with-volume
restart: unless-stopped
depends_on:
- rathole
volumes:
- ./website:/usr/share/nginx/html
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
- proxy
networks:
proxy:
external: true rathole.clinet.toml [client]
remote_addr = "152.70.160.21:2333"
# I have tried both with and without Noise
# [client.transport]
# type = "noise"
# [client.transport.noise]
# remote_public_key = "..."
[client.services.nginx-http]
token = "my token"
local_addr = "nginx-with-volume:5080" Nginx serves a simple html page on port <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello world</title>
</head>
<body>
<h1>Hello world</h1>
</body>
</html> Initially I tried exposing Traefik in local network with tunneled I opened TCP Here are the errors: Telnet and Curl on port 80:
Ports on server:
Rathole server logs:
Rathole client logs:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got it to work. Client ports were incorrectly configured, it should be like this: docker-compose.yml version: '3.8'
services:
rathole:
image: rapiz1/rathole:v0.5.0
command: --client /config/rathole.client.toml
restart: unless-stopped
volumes:
- ./rathole.client.toml:/config/rathole.client.toml:ro
# do not expose any ports here
networks:
- proxy
nginx-with-volume:
image: nginx:stable-alpine3.17-slim
container_name: nginx-with-volume
restart: unless-stopped
depends_on:
- rathole
volumes:
- ./website:/usr/share/nginx/html
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
- proxy
networks:
proxy:
external: true rathole.clinet.toml [client]
remote_addr = "152.70.160.21:2333"
# I have tried both with and without Noise
# [client.transport]
# type = "noise"
# [client.transport.noise]
# remote_public_key = "..."
[client.services.nginx-http]
token = "my token"
local_addr = "nginx-with-volume:8080" # correct
# this was main mistake, rathole already knows on which port traffic is coming from
# rathole should pass traffic directly on port of the app without any port mapping in docker-compose.yml
# local_addr = "nginx-with-volume:5080" # incorrect |
Beta Was this translation helpful? Give feedback.
I got it to work. Client ports were incorrectly configured, it should be like this:
docker-compose.yml