rathole icon indicating copy to clipboard operation
rathole copied to clipboard

convert frp config to rathole

Open shabakett opened this issue 3 years ago • 4 comments

how to use rathole and nginx to achieve the same result as these frp conf:

server : frps.ini

[common]
bind_port = 7000
vhost_http_port = 7080
subdomain_host = example.com

[plugin.authentication]
addr = https://api.example.com 
path = /tunnel_auth # authenticate using "user" and "meta_access_key"
ops = Login
tls_verify = false

machine1 : frpc.ini

[common]
server_addr = example.com
server_port = 7000
user = client1
meta_access_key = key1

[http]
type = http
local_port = 8080
subdomain = sub1
http_user = u1
http_pwd = p1

machine2 : frpc.ini

[common]
server_addr = example.com
server_port = 7000
user = client2
meta_access_key = key2

[http]
type = http
local_port = 8080
subdomain = sub2	
http_user = u2
http_pwd = p2

shabakett avatar Nov 24 '22 16:11 shabakett

Duplicate of https://github.com/rapiz1/rathole/issues/159

emilyastranova avatar Nov 27 '22 00:11 emilyastranova

how to replace these parameters: vhost_http_port, subdomain_host, subdomain, meta_*, user, http_user, [plugin.authentication]?

shabakett avatar Nov 27 '22 07:11 shabakett

In the "out of scope" document they mention they aren't remaking HTTP things (they called it "just making Nginx again")

emilyastranova avatar Nov 28 '22 06:11 emilyastranova

YOU SHOULD READ DOCUMENTATION FIRST to solve your problems. AND GO TO DISCUSSIONS to ask questions.

Back to your questions:

how to replace these parameters: vhost_http_port, subdomain_host, subdomain, meta_*, user, http_user, [plugin.authentication]?

For those HTTP things vhost_http_port, subdomain_host, subdomain, just read this part of nginx docs, all you need is just a reverse proxy like:

server {
  listen 80;
  server_name example.com; # Your full subdomain here.

  ... # Some other parameters.

  location / {
    proxy_pass http://127.0.0.1:8081/; # Server side port of service.
    proxy_set_header Host $host; # Your full subdomain here for HTTP host header.
    ... # Some other parameters.
  }
}

For the other parameters meta_*, user, http_user, [plugin.authentication], you can use default_token, TLS or Noise Protocol to do that on Rathole. In Noise Protocol, you can use the authentication methods you expect:

Read Interactive handshake patterns (fundamental) to get more information about that.

As above, everything you need is just in the documentation, try to solve your problems on your own first, and go to discussions to ask questions next time, I believe this will cause trouble for developers.

Hope this helps you, have a nice day :)

fernvenue avatar Nov 28 '22 08:11 fernvenue