ntnj / tunwg

Secure private tunnel to your local servers
https://tunwg.com
MIT License
212 stars 8 forks source link

Handshakre fails after initial connection #9

Closed niravjdn closed 1 month ago

niravjdn commented 1 month ago

I am self hosting it on my VM on oracle cloud. This is my docker compose from client machine.

version: "3.3"
services:
    tunwg:
      image: ghcr.io/ntnj/tunwg
      container_name: custom_tunwg
      environment:
        TUNWG_API: "l.abc.xyz"
      command: tunwg --forward=http://192.168.2.229:8096,http://192.168.2.229:8081

It shows generated url and it shows initiating handshake.

08/09 03:41:14 tunwg: initiating handshake to server
2024/08/09 03:41:14 tunwg: http://192.168.2.229:8096 <= https://a4yyyzritlu5xlqs.l.abc.xyz
2024/08/09 03:41:14 tunwg: http://192.168.2.229:8081 <= https://a4yyyzritlu5wa4c.l.abc.xyz
2024/08/09 03:41:44 tunwg: initiating handshake to server
2024/08/09 03:42:14 tunwg: initiating handshake to server
2024/08/09 03:42:44 tunwg: initiating handshake to server
2024/08/09 03:43:14 tunwg: initiating handshake to server

This are my logs on server.

nwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:17092/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:58932/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:26548/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:51361/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:27654/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:49225/10.0.0.236:443; closing
unwgs_1  | 2024/08/09 03:43:55 received request for: 140.238.xxx.146
unwgs_1  | 2024/08/09 03:43:55 dispatch error: failed to lookup cname 140.238.xxx.146: lookup 140.238.xxx.146: no such host
unwgs_1  | 2024/08/09 03:43:55 tcpproxy: no routes matched conn 34.96.44.113:23460/10.0.0.236:443; closing
niravjdn commented 1 month ago

I have also got below errors now when I try to call urls generated from browser.

nwgs_1  | ERROR: tunwg: 2024/08/09 04:12:09 peer(vqXh…ilS0) - Failed to send handshake initiation: no known endpoint for peer
niravjdn commented 1 month ago

Found the issue and fix.

I was missing UDP 443 port to be allowed on Instance. I had only TCP 80 and 443. Adding UDP 443 to allow list made it work.