Skip to content

Commit dde734c

Browse files
authored
Merge pull request #188 from fatedier/dev
bump version to 0.9.0
2 parents b8a28e9 + 5532881 commit dde734c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5926
-190
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.git
3+
*~
4+
*#
5+
.#*

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ language: go
33

44
go:
55
- 1.5.4
6-
- 1.6.3
7-
- 1.7rc6
6+
- 1.6.4
7+
- 1.7.4
88

99
install:
1010
- make

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM golang:1.6
2+
3+
COPY . /go/src/github.com/fatedier/frp
4+
5+
RUN cd /go/src/github.com/fatedier/frp \
6+
&& make \
7+
&& mv bin/frpc /frpc \
8+
&& mv bin/frps /frps \
9+
&& mv conf/frpc_min.ini /frpc.ini \
10+
&& mv conf/frps_min.ini /frps.ini \
11+
&& make clean
12+
13+
WORKDIR /
14+
15+
EXPOSE 80 443 6000 7000 7500
16+
17+
ENTRYPOINT ["/frps"]

Dockerfile_alpine

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM alpine:3.4
2+
3+
COPY bin/frpc /frpc
4+
COPY bin/frps /frps
5+
COPY conf/frpc_min.ini /frpc.ini
6+
COPY conf/frps_min.ini /frps.ini
7+
8+
WORKDIR /
9+
10+
EXPOSE 80 443 6000 7000 7500
11+
12+
ENTRYPOINT ["/frps"]

Godeps/Godeps.json

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile.cross-compiles

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ export GO15VENDOREXPERIMENT := 1
33

44
all: build
55

6-
build: gox app
6+
build: gox app more
77

88
gox:
99
go get github.com/mitchellh/gox
1010

1111
app:
1212
gox -osarch "darwin/386 darwin/amd64 linux/386 linux/amd64 linux/arm windows/386 windows/amd64" ./src/...
13+
14+
more:
15+
env GOOS=linux GOARCH=mips64 go build -o ./frpc_linux_mips64 ./src/cmd/frpc
16+
env GOOS=linux GOARCH=mips64 go build -o ./frps_linux_mips64 ./src/cmd/frps
17+
env GOOS=linux GOARCH=mips64le go build -o ./frpc_linux_mips64le ./src/cmd/frpc
18+
env GOOS=linux GOARCH=mips64le go build -o ./frps_linux_mips64le ./src/cmd/frps

README.md

Lines changed: 135 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,35 @@ frp is a fast reverse proxy to help you expose a local server behind a NAT or fi
1010

1111
## Catalog
1212

13+
<!-- vim-markdown-toc GFM -->
1314
* [What can I do with frp?](#what-can-i-do-with-frp)
1415
* [Status](#status)
1516
* [Architecture](#architecture)
1617
* [Example Usage](#example-usage)
17-
* [Communicate with your computer in LAN by SSH](#communicate-with-your-computer-in-lan-by-ssh)
18-
* [Visit your web service in LAN by custom domains](#visit-your-web-service-in-lan-by-custom-domains)
18+
* [Communicate with your computer in LAN by SSH](#communicate-with-your-computer-in-lan-by-ssh)
19+
* [Visit your web service in LAN by custom domains](#visit-your-web-service-in-lan-by-custom-domains)
20+
* [Forward DNS query request](#forward-dns-query-request)
1921
* [Features](#features)
20-
* [Dashboard](#dashboard)
21-
* [Authentication](#authentication)
22-
* [Encryption and Compression](#encryption-and-compression)
23-
* [Reload configures without frps stopped](#reload-configures-without-frps-stopped)
24-
* [Privilege Mode](#privilege-mode)
25-
* [Port White List](#port-white-list)
26-
* [Connection Pool](#connection-pool)
27-
* [Rewriting the Host Header](#rewriting-the-host-header)
22+
* [Dashboard](#dashboard)
23+
* [Authentication](#authentication)
24+
* [Encryption and Compression](#encryption-and-compression)
25+
* [Reload configures without frps stopped](#reload-configures-without-frps-stopped)
26+
* [Privilege Mode](#privilege-mode)
27+
* [Port White List](#port-white-list)
28+
* [Connection Pool](#connection-pool)
29+
* [Rewriting the Host Header](#rewriting-the-host-header)
30+
* [Password protecting your web service](#password-protecting-your-web-service)
31+
* [Custom subdomain names](#custom-subdomain-names)
32+
* [Connect frps by HTTP PROXY](#connect-frps-by-http-proxy)
2833
* [Development Plan](#development-plan)
2934
* [Contributing](#contributing)
3035
* [Donation](#donation)
36+
* [AliPay](#alipay)
37+
* [Paypal](#paypal)
3138
* [Contributors](#contributors)
3239

40+
<!-- vim-markdown-toc -->
41+
3342
## What can I do with frp?
3443

3544
* Expose any http and https service behind a NAT or firewall to the internet by a server with public IP address(Name-based Virtual Host Support).
@@ -82,6 +91,8 @@ Put **frpc** and **frpc.ini** to your server in LAN.
8291
auth_token = 123
8392

8493
[ssh]
94+
type = tcp
95+
local_ip = 127.0.0.1
8596
local_port = 22
8697
```
8798

@@ -139,6 +150,48 @@ Howerver, we can expose a http or https service using frp.
139150

140151
6. Now visit your local web service using url `http://www.yourdomain.com:8080`.
141152

153+
### Forward DNS query request
154+
155+
1. Modify frps.ini, configure a reverse proxy named [dns]:
156+
157+
```ini
158+
# frps.ini
159+
[common]
160+
bind_port = 7000
161+
162+
[dns]
163+
type = udp
164+
listen_port = 6000
165+
auth_token = 123
166+
```
167+
168+
2. Start frps:
169+
170+
`./frps -c ./frps.ini`
171+
172+
3. Modify frpc.ini, set remote frps's server IP as x.x.x.x, forward dns query request to google dns server `8.8.8.8:53`:
173+
174+
```ini
175+
# frpc.ini
176+
[common]
177+
server_addr = x.x.x.x
178+
server_port = 7000
179+
auth_token = 123
180+
181+
[dns]
182+
type = udp
183+
local_ip = 8.8.8.8
184+
local_port = 53
185+
```
186+
187+
4. Start frpc:
188+
189+
`./frpc -c ./frpc.ini`
190+
191+
5. Send dns query request by dig:
192+
193+
`dig @x.x.x.x -p 6000 www.goolge.com`
194+
142195
## Features
143196

144197
### Dashboard
@@ -150,9 +203,12 @@ Configure a port for dashboard to enable this feature:
150203
```ini
151204
[common]
152205
dashboard_port = 7500
206+
# dashboard's username and password are both optional,if not set, default is admin.
207+
dashboard_user = admin
208+
dashboard_pwd = admin
153209
```
154210

155-
Then visit `http://[server_addr]:7500` to see dashboard.
211+
Then visit `http://[server_addr]:7500` to see dashboard, default username and password are both `admin`.
156212

157213
![dashboard](/doc/pic/dashboard.png)
158214

@@ -164,6 +220,8 @@ Client that want's to register must set a global `auth_token` equals to frps.ini
164220

165221
Note that time duration bewtween frpc and frps mustn't exceed 15 minutes because timestamp is used for authentication.
166222

223+
Howerver, this timeout duration can be modified by setting `authentication_timeout` in frps's configure file. It's defalut value is 900, means 15 minutes. If it is equals 0, then frps will not check authentication timeout.
224+
167225
### Encryption and Compression
168226

169227
Defalut value is false, you could decide if the proxy will use encryption or compression whether the type is:
@@ -311,11 +369,67 @@ host_header_rewrite = dev.yourdomain.com
311369

312370
If `host_header_rewrite` is specified, the Host header will be rewritten to match the hostname portion of the forwarding address.
313371

372+
### Password protecting your web service
373+
374+
Anyone who can guess your tunnel URL can access your local web server unless you protect it with a password.
375+
376+
This enforces HTTP Basic Auth on all requests with the username and password you specify in frpc's configure file.
377+
378+
It can be only enabled when proxy type is http.
379+
380+
```ini
381+
# frpc.ini
382+
[web]
383+
privilege_mode = true
384+
type = http
385+
local_port = 80
386+
custom_domains = test.yourdomain.com
387+
http_user = abc
388+
http_pwd = abc
389+
```
390+
391+
Visit `test.yourdomain.com` and now you need to input username and password.
392+
393+
### Custom subdomain names
394+
395+
It is convenient to use `subdomain` configure for http、https type when many people use one frps server together.
396+
397+
```ini
398+
# frps.ini
399+
subdomain_host = frps.com
400+
```
401+
402+
Resolve `*.frps.com` to the frps server's IP.
403+
404+
```ini
405+
# frpc.ini
406+
[web]
407+
privilege_mode = true
408+
type = http
409+
local_port = 80
410+
subdomain = test
411+
```
412+
413+
Now you can visit your web service by host `test.frps.com`.
414+
415+
Note that if `subdomain_host` is not empty, `custom_domains` should not be the subdomain of `subdomain_host`.
416+
417+
### Connect frps by HTTP PROXY
418+
419+
frpc can connect frps using HTTP PROXY if you set os environment `HTTP_PROXY` or configure `http_proxy` param in frpc.ini file.
420+
421+
```ini
422+
# frpc.ini
423+
server_addr = x.x.x.x
424+
server_port = 7000
425+
http_proxy = http://user:[email protected]:8080
426+
```
427+
314428
## Development Plan
315429

316-
* Support udp protocol.
317-
* Support wildcard domain name.
318430
* Url router.
431+
* Log http request information in frps.
432+
* Direct reverse proxy, like haproxy.
319433
* Load balance to different service in frpc.
320434
* Debug mode for frpc, prestent proxy status in terminal.
321435
* Inspect all http requests/responses that are transmitted over the tunnel.
@@ -327,7 +441,9 @@ If `host_header_rewrite` is specified, the Host header will be rewritten to matc
327441

328442
Interested in getting involved? We would like to help you!
329443

330-
* Take a look at our [issues list](https://github.com/fatedier/frp/issues) and consider submitting a patch
444+
* Take a look at our [issues list](https://github.com/fatedier/frp/issues) and consider sending a Pull Request to **dev branch**.
445+
* If you want to add a new feature, please create an issue first to describe the new feature, as well as the implementation approach. Once a proposal is accepted, create an implementation of the new features and submit it as a pull request.
446+
* Sorry for my poor english and improvement for this document is welcome even some typo fix.
331447
* If you have some wanderful ideas, send email to [email protected].
332448

333449
**Note: We prefer you to give your advise in [issues](https://github.com/fatedier/frp/issues), so others with a same question can search it quickly and we don't need to answer them repeatly.**
@@ -348,5 +464,8 @@ Donate money by [paypal](https://www.paypal.me/fatedier) to my account **fatedie
348464

349465
* [fatedier](https://github.com/fatedier)
350466
* [Hurricanezwf](https://github.com/Hurricanezwf)
351-
* [vashstorm](https://github.com/vashstorm)
352-
* [maodanp](https://github.com/maodanp)
467+
* [Pan Hao](https://github.com/vashstorm)
468+
* [Danping Mao](https://github.com/maodanp)
469+
* [Eric Larssen](https://github.com/ericlarssen)
470+
* [Damon Zhao](https://github.com/se77en)
471+
* [Manfred Touron](https://github.com/moul)

0 commit comments

Comments
 (0)