Closed mrbluecoat closed 11 months ago
You should read the README completely. The type
you mentioned is the transport type under transport
category. Currently, rathole supports the three types mentioned in the README:
...
[client.transport] # The whole block is optional. Specify which transport to use
type = "tcp" # Optional. Possible values: ["tcp", "tls", "noise"]. Default: "tcp"
...
However, for each service, you need to specify the type, as stated in the README. Currently, rathole supports any type of TCP and UDP:
...
[client.services.service1] # A service that needs forwarding. The name `service1` can change arbitrarily, as long as identical to the name in the server's configuration
type = "tcp" # Optional. The protocol that needs forwarding. Possible values: ["tcp", "udp"]. Default: "tcp"
...
Oh, sorry. Isn't UDP a transport? Better question: which transport type should I use with WireGuard?
Short answer: tcp
, because WireGuard already has encryption, you don't need additional one, so tls
and noise
is not for you. By the way, tcp
is the default option for transport, so you can just skip this whole block. Let me give you an example:
[server]
bind_addr = "0.0.0.0:2333"
[server.services.wireguard]
type = "udp"
bind_addr = "0.0.0.0:9573"
[client]
remote_addr = "myserver.com:2333"
[client.services.wireguard]
type = "udp"
local_addr = "127.0.0.1:9573"
Is that clear? In this way, your WireGuard can be access on the server's 9573 port.
Awesome, thanks!
How come UDP is so much slower than TCP? Isn't it supposed to be faster? Is this some kind of mistake?
I noticed you had an old code merge that introduced UDP support but your README says
type = "tcp" # Optional. Possible values: ["tcp", "tls", "noise"]. Default: "tcp"
Does rathole support UDP (for example, exposing a WireGuard or IKEv2 server behind NAT to the internet)?