You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Connecting to frps via HTTP PROXY](#connecting-to-frps-via-http-proxy)
56
61
*[Range ports mapping](#range-ports-mapping)
57
62
*[Client Plugins](#client-plugins)
@@ -435,9 +440,59 @@ admin_pwd = admin
435
440
436
441
Then visit `http://127.0.0.1:7400` to see admin UI, with username and password both being `admin` by default.
437
442
443
+
### Monitor
444
+
445
+
When dashboard is enabled, frps will save monitor data in cache. It will be cleared after process restart.
446
+
447
+
Prometheus is also supported.
448
+
449
+
#### Prometheus
450
+
451
+
Enable dashboard first, then configure `enable_prometheus = true` in `frps.ini`.
452
+
453
+
`http://{dashboard_addr}/metrics` will provide prometheus monitor data.
454
+
438
455
### Authenticating the Client
439
456
440
-
Always use the same `token` in the `[common]` section in `frps.ini` and `frpc.ini`.
457
+
There are 2 authentication methods to authenticate frpc with frps.
458
+
459
+
You can decide which one to use by configuring `authentication_method` under `[common]` in `frpc.ini` and `frps.ini`.
460
+
461
+
Configuring `authenticate_heartbeats = true` under `[common]` will use the configured authentication method to add and validate authentication on every heartbeat between frpc and frps.
462
+
463
+
Configuring `authenticate_new_work_conns = true` under `[common]` will do the same for every new work connection between frpc and frps.
464
+
465
+
#### Token Authentication
466
+
467
+
When specifying `authentication_method = token` under `[common]` in `frpc.ini` and `frps.ini` - token based authentication will be used.
468
+
469
+
Make sure to specify the same `token` in the `[common]` section in `frps.ini` and `frpc.ini` for frpc to pass frps validation
470
+
471
+
#### OIDC Authentication
472
+
473
+
When specifying `authentication_method = oidc` under `[common]` in `frpc.ini` and `frps.ini` - OIDC based authentication will be used.
474
+
475
+
OIDC stands for OpenID Connect, and the flow used is called [Client Credentials Grant](https://tools.ietf.org/html/rfc6749#section-4.4).
476
+
477
+
To use this authentication type - configure `frpc.ini` and `frps.ini` as follows:
@@ -461,6 +516,8 @@ Config `tls_enable = true` in the `[common]` section to `frpc.ini` to enable thi
461
516
462
517
For port multiplexing, frp sends a first byte `0x17` to dial a TLS connection.
463
518
519
+
To enforce `frps` to only accept TLS connections - configure `tls_only = true` in the `[common]` section in `frps.ini`.
520
+
464
521
### Hot-Reloading frpc configuration
465
522
466
523
The `admin_addr` and `admin_port` fields are required for enabling HTTP API:
@@ -712,7 +769,7 @@ proxy_protocol_version = v2
712
769
713
770
You can enable Proxy Protocol support in nginx to expose user's real IP in HTTP header `X-Real-IP`, and then read `X-Real-IP` header in your web service for the real IP.
714
771
715
-
### Require HTTP Basic auth (password) for web services
772
+
### Require HTTP Basic Auth (Password) for Web Services
716
773
717
774
Anyone who can guess your tunnel URL can access your local web server unless you protect it with a password.
718
775
@@ -732,7 +789,7 @@ http_pwd = abc
732
789
733
790
Visit `http://test.example.com` in the browser and now you are prompted to enter the username and password.
734
791
735
-
### Custom subdomain names
792
+
### Custom Subdomain Names
736
793
737
794
It is convenient to use `subdomain` configure for http and https types when many people share one frps server.
738
795
@@ -755,7 +812,7 @@ Now you can visit your web service on `test.frps.com`.
755
812
756
813
Note that if `subdomain_host` is not empty, `custom_domains` should not be the subdomain of `subdomain_host`.
757
814
758
-
### URL routing
815
+
### URL Routing
759
816
760
817
frp supports forwarding HTTP requests to different backend web services by url routing.
761
818
@@ -778,6 +835,49 @@ locations = /news,/about
778
835
779
836
HTTP requests with URL prefix `/news` or `/about` will be forwarded to **web02** and other requests to **web01**.
780
837
838
+
### TCP Port Multiplexing
839
+
840
+
frp supports receiving TCP sockets directed to different proxies on a single port on frps, similar to `vhost_http_port` and `vhost_https_port`.
841
+
842
+
The only supported TCP port multiplexing method available at the moment is `httpconnect` - HTTP CONNECT tunnel.
843
+
844
+
When setting `tcpmux_httpconnect_port` to anything other than 0 in frps under `[common]`, frps will listen on this port for HTTP CONNECT requests.
845
+
846
+
The host of the HTTP CONNECT request will be used to match the proxy in frps. Proxy hosts can be configured in frpc by configuring `custom_domain` and / or `subdomain` under `type = tcpmux` proxies, when `multiplexer = httpconnect`.
847
+
848
+
For example:
849
+
850
+
```ini
851
+
# frps.ini
852
+
[common]
853
+
bind_port = 7000
854
+
tcpmux_httpconnect_port = 1337
855
+
```
856
+
857
+
```ini
858
+
# frpc.ini
859
+
[common]
860
+
server_addr = x.x.x.x
861
+
server_port = 7000
862
+
863
+
[proxy1]
864
+
type = tcpmux
865
+
multiplexer = httpconnect
866
+
custom_domains = test1
867
+
868
+
[proxy2]
869
+
type = tcpmux
870
+
multiplexer = httpconnect
871
+
custom_domains = test2
872
+
```
873
+
874
+
In the above configuration - frps can be contacted on port 1337 with a HTTP CONNECT header such as:
875
+
876
+
```
877
+
CONNECT test1 HTTP/1.1\r\n\r\n
878
+
```
879
+
and the connection will be routed to `proxy1`.
880
+
781
881
### Connecting to frps via HTTP PROXY
782
882
783
883
frpc can connect to frps using HTTP proxy if you set OS environment variable `HTTP_PROXY`, or if `http_proxy` is set in frpc.ini file.
0 commit comments