mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
2.1 KiB
2.1 KiB
Quick Start
frp is easier to use compared with other similar projects.
We will use a simple demo to demonstrate how to create a connection to server A's ssh port by server B with public IP address x.x.x.x(replace to the real IP address of your server).
Download SourceCode
go get github.com/fatedier/frp
is recommended, then the code will be copied to the directory $GOPATH/src/github.com/fatedier/frp
.
Or you can use git clone https://github.com/fatedier/frp.git $GOPATH/src/github.com/fatedier/frp
.
Compile
Enter the root directory and execute make
, then wait until finished.
bin include all executable programs when conf include corresponding configuration files.
Pre-requirement
- Go environment. Version of go >= 1.4.
- Godep (if not exist, go get will be executed to download godep when compiling)
Deploy
- Move
./bin/frps
and./conf/frps.ini
to any directory of server B. - Move
./bin/frpc
and./conf/frpc.ini
to any directory of server A. - Modify all configuration files, details in next paragraph.
- Execute
nohup ./frps &
ornohup ./frps -c ./frps.ini &
in server B. - Execute
nohup ./frpc &
ornohup ./frpc -c ./frpc.ini &
in server A. - Use
ssh -oPort=6000 {user}@x.x.x.x
to test if frp is work(replace {user} to real username in server A).
Configuration files
frps.ini
[common]
bind_addr = 0.0.0.0
# for accept connections from frpc
bind_port = 7000
log_file = ./frps.log
log_level = info
# test is the custom name of proxy and there can be many proxies with unique name in one configure file
[test]
auth_token = 123
bind_addr = 0.0.0.0
# finally we connect to server A by this port
listen_port = 6000
frpc.ini
[common]
# server address of frps
server_addr = x.x.x.x
server_port = 7000
log_file = ./frpc.log
log_level = info
# for authentication
auth_token = 123
# test is proxy name same with configure in frps.ini
[test]
# local port which need to be transferred
local_port = 22
# if use_encryption equals true, messages between frpc and frps will be encrypted, default is false
use_encryption = true