Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
Last active August 22, 2023 10:41
Show Gist options
  • Save rockavoldy/c0aebe0ea394c2252c53021113a2aeca to your computer and use it in GitHub Desktop.
Save rockavoldy/c0aebe0ea394c2252c53021113a2aeca to your computer and use it in GitHub Desktop.
FRP Configuration

Server

FRPs Configuration

# file /etc/frps.ini

[common]
bind_port = 7000
vhost_http_port = 8080
subdomain_host = your.domain.tld

HTTP Server Reverse Proxy

# file /etc/caddy/Caddyfile

*.your.domain.tld {
  reverse_proxy localhost:8080
}

Systemd Service

# file /etc/systemd/system/frps.service

[Unit]
Description=FRP Server
After=network.target

[Service]
Type=simple
User=root
Restart=always
RestartSec=5s
ExecStart=/usr/local/bin/frps -c /etc/frps.ini
PermissionsStartOnly=true
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sleepservice

[Install]
WantedBy=multi-user.target

Client

FRPc Configuration

# file /etc/frpc.ini

[common]
server_addr = <your-server-ip-address>
server_port = 7000

[test]
type = http
local_ip = 127.0.0.1
local_port = <your-local-app-port>
subdomain = test

Systemd Service

# file /etc/systemd/system/frpc.service

[Unit]
Description=FRP Client
After=network.target

[Service]
Type=simple
User=root
Restart=always
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /etc/frpc.ini
PermissionsStartOnly=true
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sleepservice

[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment