Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
feat: change go dep to go module to manage project
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <liu_df@qq.com>
  • Loading branch information
apcoin committed Apr 5, 2022
1 parent 457af8a commit 4315fca
Show file tree
Hide file tree
Showing 123 changed files with 209 additions and 14,045 deletions.
67 changes: 0 additions & 67 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ fmt:
go fmt ./...

xfrps:
go build -o bin/xfrps ./cmd/frps
go build -o bin/xfrps ./cmd/xfrps
@cp -rf ./assets/static ./bin

xfrpc:
go build -o bin/xfrpc ./cmd/frpc
go build -o bin/xfrpc ./cmd/xfrpc

test: gotest

Expand Down
42 changes: 21 additions & 21 deletions Makefile.cross-compiles
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ all: build
build: app

app:
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_darwin_amd64 ./cmd/frpc
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_darwin_amd64 ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_386 ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_386 ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_amd64 ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_amd64 ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_arm ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_arm ./cmd/frps
env CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_windows_386.exe ./cmd/frpc
env CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrps_windows_386.exe ./cmd/frps
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_windows_amd64.exe ./cmd/frpc
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_windows_amd64.exe ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips64 ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips64 ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips64le ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips64le ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mipsle ./cmd/frpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mipsle ./cmd/frps
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_darwin_amd64 ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_darwin_amd64 ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_386 ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_386 ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_amd64 ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_amd64 ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_arm ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_arm ./cmd/xfrps
env CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_windows_386.exe ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "$(LDFLAGS)" -o ./xfrps_windows_386.exe ./cmd/xfrps
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_windows_amd64.exe ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_windows_amd64.exe ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips64 ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips64 ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips64le ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips64le ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mips ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mips ./cmd/xfrps
env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "$(LDFLAGS)" -o ./xfrpc_linux_mipsle ./cmd/xfrpc
env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_mipsle ./cmd/xfrps

temp:
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_amd64 ./cmd/frps
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o ./xfrps_linux_amd64 ./cmd/xfrps
2 changes: 1 addition & 1 deletion assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/rakyll/statik/fs"

_ "github.com/KunTengRom/xfrps/assets/statik"
_ "github.com/liudf0716/xfrps/assets/statik"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion assets/static/index.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions client/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"sync"
"time"

"github.com/KunTengRom/xfrps/models/config"
"github.com/KunTengRom/xfrps/models/msg"
"github.com/KunTengRom/xfrps/utils/crypto"
"github.com/KunTengRom/xfrps/utils/log"
"github.com/KunTengRom/xfrps/utils/net"
"github.com/KunTengRom/xfrps/utils/util"
"github.com/KunTengRom/xfrps/utils/version"
"github.com/liudf0716/xfrps/models/config"
"github.com/liudf0716/xfrps/models/msg"
"github.com/liudf0716/xfrps/utils/crypto"
"github.com/liudf0716/xfrps/utils/log"
"github.com/liudf0716/xfrps/utils/net"
"github.com/liudf0716/xfrps/utils/util"
"github.com/liudf0716/xfrps/utils/version"
"github.com/xtaci/smux"
)

Expand Down
16 changes: 8 additions & 8 deletions client/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import (
"sync"
"time"

"github.com/KunTengRom/xfrps/models/config"
"github.com/KunTengRom/xfrps/models/msg"
"github.com/KunTengRom/xfrps/models/plugin"
"github.com/KunTengRom/xfrps/models/proto/tcp"
"github.com/KunTengRom/xfrps/models/proto/udp"
"github.com/KunTengRom/xfrps/utils/errors"
"github.com/KunTengRom/xfrps/utils/log"
frpNet "github.com/KunTengRom/xfrps/utils/net"
"github.com/liudf0716/xfrps/models/config"
"github.com/liudf0716/xfrps/models/msg"
"github.com/liudf0716/xfrps/models/plugin"
"github.com/liudf0716/xfrps/models/proto/tcp"
"github.com/liudf0716/xfrps/models/proto/udp"
"github.com/liudf0716/xfrps/utils/errors"
"github.com/liudf0716/xfrps/utils/log"
frpNet "github.com/liudf0716/xfrps/utils/net"
)

// Proxy defines how to work for different proxy type.
Expand Down
2 changes: 1 addition & 1 deletion client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package client

import "github.com/KunTengRom/xfrps/models/config"
import "github.com/liudf0716/xfrps/models/config"

type Service struct {
// manager control connection with server
Expand Down
Binary file removed cmd/frpc/frpc
Binary file not shown.
Binary file removed cmd/frps/frps
Binary file not shown.
8 changes: 4 additions & 4 deletions cmd/frpc/main.go → cmd/xfrpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
docopt "github.com/docopt/docopt-go"
ini "github.com/vaughan0/go-ini"

"github.com/KunTengRom/xfrps/client"
"github.com/KunTengRom/xfrps/models/config"
"github.com/KunTengRom/xfrps/utils/log"
"github.com/KunTengRom/xfrps/utils/version"
"github.com/liudf0716/xfrps/client"
"github.com/liudf0716/xfrps/models/config"
"github.com/liudf0716/xfrps/utils/log"
"github.com/liudf0716/xfrps/utils/version"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions cmd/frps/main.go → cmd/xfrps/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
docopt "github.com/docopt/docopt-go"
ini "github.com/vaughan0/go-ini"

"github.com/KunTengRom/xfrps/models/config"
"github.com/KunTengRom/xfrps/server"
"github.com/KunTengRom/xfrps/utils/log"
"github.com/KunTengRom/xfrps/utils/version"
"github.com/liudf0716/xfrps/models/config"
"github.com/liudf0716/xfrps/server"
"github.com/liudf0716/xfrps/utils/log"
"github.com/liudf0716/xfrps/utils/version"
)

var usage string = `frps is the server of frp
Expand Down
40 changes: 20 additions & 20 deletions doc/quick_start_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ We will use two simple demo to demonstrate how to use frp.

### Download SourceCode

`go get github.com/KunTengRom/xfrps` is recommended, then the code will be copied to the directory `$GOPATH/src/github.com/KunTengRom/xfrps`.
`go get github.com/liudf0716/xfrps` is recommended, then the code will be copied to the directory `$GOPATH/src/github.com/liudf0716/xfrps`.

Or you can use `git clone https://github.com/KunTengRom/xfrps.git $GOPATH/src/github.com/KunTengRom/xfrps`.
Or you can use `git clone https://github.com/liudf0716/xfrps.git $GOPATH/src/github.com/liudf0716/xfrps`.

If you want to try it quickly, download the compiled program and configuration files from [https://github.com/KunTengRom/xfrps/releases](https://github.com/KunTengRom/xfrps/releases).
If you want to try it quickly, download the compiled program and configuration files from [https://github.com/liudf0716/xfrps/releases](https://github.com/liudf0716/xfrps/releases).

### Compile

Expand All @@ -28,25 +28,25 @@ Enter the root directory and execute `make`, then wait until finished.

### Deploy

1. Move `./bin/frps` and `./conf/frps.ini` to any directory of **server B**.
2. Move `./bin/frpc` and `./conf/frpc.ini` to any directory of **server A**.
1. Move `./bin/xfrps` and `./conf/xfrps.ini` to any directory of **server B**.
2. Move `./bin/xfrpc` and `./conf/xfrpc.ini` to any directory of **server A**.
3. Modify all configuration files, details in next paragraph.
4. Execute `nohup ./frps &` or `nohup ./frps -c ./frps.ini &` in **server B**.
5. Execute `nohup ./frpc &` or `nohup ./frpc -c ./frpc.ini &` in **server A**.
4. Execute `nohup ./xfrps &` or `nohup ./xfrps -c ./xfrps.ini &` in **server B**.
5. Execute `nohup ./xfrpc &` or `nohup ./xfrpc -c ./xfrpc.ini &` in **server A**.
6. Use `ssh -oPort=6000 {user}@x.x.x.x` to test if frp is work(replace {user} to real username in **server A**), or visit custom domains by browser.

## Tcp port forwarding

### Configuration files

#### frps.ini
#### xfrps.ini

```ini
[common]
bind_addr = 0.0.0.0
# for accept connections from frpc
# for accept connections from xfrpc
bind_port = 7000
log_file = ./frps.log
log_file = ./xfrps.log
log_level = info

# ssh is the custom name of proxy and there can be many proxies with unique name in one configure file
Expand All @@ -57,23 +57,23 @@ bind_addr = 0.0.0.0
listen_port = 6000
```

#### frpc.ini
#### xfrpc.ini

```ini
[common]
# server address of frps
# server address of xfrps
server_addr = x.x.x.x
server_port = 7000
log_file = ./frpc.log
log_file = ./xfrpc.log
log_level = info
# for authentication
auth_token = 123

# ssh is proxy name same with configure in frps.ini
# ssh is proxy name same with configure in xfrps.ini
[ssh]
# 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
# if use_encryption equals true, messages between xfrpc and xfrps will be encrypted, default is false
use_encryption = true
```

Expand All @@ -87,15 +87,15 @@ After that, you can visit your web pages in local server by custom domains.

### Configuration files

#### frps.ini
#### xfrps.ini

```ini
[common]
bind_addr = 0.0.0.0
bind_port = 7000
# if you want to support vhost, specify one port for http services
vhost_http_port = 80
log_file = ./frps.log
log_file = ./xfrps.log
log_level = info

[web01]
Expand All @@ -110,17 +110,17 @@ auth_token = 123
custom_domains = web02.yourdomain.com
```

#### frpc.ini
#### xfrpc.ini

```ini
[common]
server_addr = x.x.x.x
server_port = 7000
log_file = ./frpc.log
log_file = ./xfrpc.log
log_level = info
auth_token = 123

# custom domains are set in frps.ini
# custom domains are set in xfrps.ini
[web01]
type = http
local_ip = 127.0.0.1
Expand Down
Loading

0 comments on commit 4315fca

Please sign in to comment.