Skip to content

Commit

Permalink
release v0.5.0 (#24)
Browse files Browse the repository at this point in the history
[new] Optimize for http services.Support virtual host and custom domain binding.
[new] Support max days of keeping log files.
[fix] Fix a bug when reconnecting.
  • Loading branch information
fatedier committed May 3, 2016
1 parent 2c39719 commit f804330
Show file tree
Hide file tree
Showing 18 changed files with 603 additions and 136 deletions.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

## What can I do with frp?

* Expose any http service behind a NAT or firewall to the internet by a server with public IP address(Name-based Virtual Host Support).
* Expose any tcp service behind a NAT or firewall to the internet by a server with public IP address.
* Inspect all http requests/responses that are transmitted over the tunnel(future).

## Status

frp is under development and you can try it with latest release version.Master branch for releasing stable version when dev branch for developing.
Expand All @@ -16,17 +22,15 @@ frp is under development and you can try it with latest release version.Master b

## Quick Start

Read the [QuickStart](doc/quick_start_en.md) | [使用文档](doc/quick_start_zh.md)
Read the [QuickStart](/doc/quick_start_en.md)

## Architecture
[Tcp port forwarding](/doc/quick_start_en.md#tcp-port-forwarding)

![architecture](doc/pic/architecture.png)
[Http port forwarding and Custom domain binding](/doc/quick_start_en.md#http-port-forwarding-and-custom-domains-binding)

## What can I do with frp?
## Architecture

* Expose any http service behind a NAT or firewall to the internet by a server with public IP address.
* Expose any tcp service behind a NAT or firewall to the internet by a server with public IP address.
* Inspect all http requests/responses that are transmitted over the tunnel(future).
![architecture](/doc/pic/architecture.png)

## Contributing

Expand Down
25 changes: 15 additions & 10 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@

[README](README.md) | [中文文档](README_zh.md)

>frp 是一个高性能的反向代理应用,可以帮助你轻松的进行内网穿透,对外网提供服务。
>frp 是一个高性能的反向代理应用,可以帮助你轻松的进行内网穿透,对外网提供服务,对于 http 服务还支持虚拟主机功能,访问80端口,可以根据域名路由到后端不同的 http 服务。
## frp 的作用?

* 利用处于内网或防火墙后的机器,对外网环境提供 http 服务。
* 对于 http 服务支持基于域名的虚拟主机,支持自定义域名绑定,使多个域名可以共用一个80端口。
* 利用处于内网或防火墙后的机器,对外网环境提供 tcp 服务,例如在家里通过 ssh 访问公司局域网内的主机。
* 可查看通过代理的所有 http 请求和响应的详细信息。(待开发)

## 开发状态

frp 目前正在前期开发阶段,master分支用于发布稳定版本,dev分支用于开发,您可以尝试下载最新的 release 版本进行测试。

**在 1.x 版本以前,交互协议都可能会被改变,不能保证向后兼容。**
**在 1.0 版本以前,交互协议都可能会被改变,不能保证向后兼容。**

## 快速开始

[QuickStart](doc/quick_start_en.md) | [使用文档](doc/quick_start_zh.md)
[使用文档](/doc/quick_start_zh.md)

## 架构
[tcp 端口转发](/doc/quick_start_zh.md#tcp-端口转发)

![architecture](doc/pic/architecture.png)
[http 端口转发,自定义域名绑定](/doc/quick_start_zh.md#http-端口转发自定义域名绑定)

## frp 的作用?
## 架构

* 利用处于内网或防火墙后的机器,对外网环境提供http服务。(针对http的优化正在开发中)
* 利用处于内网或防火墙后的机器,对外网环境提供tcp服务。
* 可查看通过代理的所有http请求和响应信息。(待开发)
![architecture](/doc/pic/architecture.png)

## 贡献代码

如果您对这个项目感兴趣,并且想要参与其中,我们非常欢迎
如果您对这个项目感兴趣,我们非常欢迎您参与其中

* 如果您需要提交问题,可以通过 [issues](https://github.com/fatedier/frp/issues) 来完成。
* 如果您有新的功能需求,可以反馈至 [email protected] 共同讨论。
Expand Down
19 changes: 17 additions & 2 deletions conf/frpc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,27 @@ server_port = 7000
log_file = ./frpc.log
# debug, info, warn, error
log_level = info
log_max_days = 3
# for authentication
auth_token = 123

# test1 is the proxy name same as server's configuration
[test1]
# ssh is the proxy name same as server's configuration
[ssh]
# tcp | http, default is tcp
type = tcp
local_ip = 127.0.0.1
local_port = 22
# true or false, if true, messages between frps and frpc will be encrypted, default is false
use_encryption = true

# Resolve your domain names to [server_addr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02, the domains are set in frps.ini
[web01]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = true

[web02]
type = http
local_ip = 127.0.0.1
local_port = 8000
19 changes: 17 additions & 2 deletions conf/frps.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@
[common]
bind_addr = 0.0.0.0
bind_port = 7000
# optional
vhost_http_port = 80
# console or real logFile path like ./frps.log
log_file = ./frps.log
# debug, info, warn, error
log_level = info
log_max_days = 3

# test1 is the proxy name, client will use this name and auth_token to connect to server
[test1]
# ssh is the proxy name, client will use this name and auth_token to connect to server
[ssh]
type = tcp
auth_token = 123
bind_addr = 0.0.0.0
listen_port = 6000

[web01]
type = http
auth_token = 123
# if proxy type equals http, custom_domains must be set separated by commas
custom_domains = web01.yourdomain.com,web01.yourdomain2.com

[web02]
type = http
auth_token = 123
custom_domains = web02.yourdomain.com
86 changes: 75 additions & 11 deletions doc/quick_start_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

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).
We will use two simple demo to demonstrate how to use frp.

1. 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).
2. How to visit web service in **server A**'s **8000 port** and **8001 port** by **web01.yourdomain.com** and **web02.yourdomain.com** through **server B** with public ID address.

### 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`.

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

### Compile

Enter the root directory and execute `make`, then wait until finished.
Expand All @@ -19,16 +24,18 @@ Enter the root directory and execute `make`, then wait until finished.
### Pre-requirement

* Go environment. Version of go >= 1.4.
* Godep (if not exist, go get will be executed to download godep when compiling)
* Godep (if not exist, `go get` will be executed to download godep when compiling)

### 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/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**.
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.
6. Use `ssh -oPort=6000 {user}@x.x.x.x` to test if frp is work(replace {user} to real username in server A).
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**.
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

Expand All @@ -42,8 +49,8 @@ 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]
# ssh is the custom name of proxy and there can be many proxies with unique name in one configure file
[ssh]
auth_token = 123
bind_addr = 0.0.0.0
# finally we connect to server A by this port
Expand All @@ -62,10 +69,67 @@ log_level = info
# for authentication
auth_token = 123

# test is proxy name same with configure in frps.ini
[test]
# ssh is proxy name same with configure in frps.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
use_encryption = true
```

## Http port forwarding and Custom domains binding

If you only want to forward port one by one, you just need refer to [Tcp port forwarding](/doc/quick_start_en.md#Tcp-port-forwarding).If you want to visit different web pages deployed in different web servers by **server B**'s **80 port**, you should specify the type as **http**.

You also need to resolve your **A record** of your custom domain to [server_addr], or resolve your **CNAME record** to [server_addr] if [server_addr] is a domain.

After that, you can visit your web pages in local server by custom domains.

### Configuration files

#### frps.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_level = info

[web01]
type = http
auth_token = 123
# # if proxy type equals http, custom_domains must be set separated by commas
custom_domains = web01.yourdomain.com

[web02]
type = http
auth_token = 123
custom_domains = web02.yourdomain.com
```

#### frpc.ini

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

# custom domains are set in frps.ini
[web01]
type = http
local_ip = 127.0.0.1
local_port = 8000
# encryption is optional, default is false
use_encryption = true

[web02]
type = http
local_ip = 127.0.0.1
local_port = 8001
```
Loading

0 comments on commit f804330

Please sign in to comment.