Skip to content

Commit

Permalink
Merge pull request #1042 from fatedier/dev
Browse files Browse the repository at this point in the history
release v0.23.0
  • Loading branch information
fatedier authored Jan 15, 2019
2 parents d5ce4d4 + 5491679 commit 649a2f2
Show file tree
Hide file tree
Showing 43 changed files with 1,838 additions and 1,327 deletions.
5 changes: 0 additions & 5 deletions .dockerignore

This file was deleted.

17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions Dockerfile_alpine

This file was deleted.

21 changes: 0 additions & 21 deletions Dockerfile_multiple_build

This file was deleted.

92 changes: 79 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@

frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet. As of now, it supports tcp & udp, as well as http and https protocols, where requests can be forwarded to internal services by domain name.

Now it also try to support p2p connect.

## Table of Contents

<!-- vim-markdown-toc GFM -->

* [What can I do with frp?](#what-can-i-do-with-frp)
* [Status](#status)
* [Architecture](#architecture)
* [Example Usage](#example-usage)
Expand All @@ -25,6 +26,7 @@ frp is a fast reverse proxy to help you expose a local server behind a NAT or fi
* [P2P Mode](#p2p-mode)
* [Features](#features)
* [Configuration File](#configuration-file)
* [Configuration file template](#configuration-file-template)
* [Dashboard](#dashboard)
* [Authentication](#authentication)
* [Encryption and Compression](#encryption-and-compression)
Expand All @@ -36,6 +38,7 @@ frp is a fast reverse proxy to help you expose a local server behind a NAT or fi
* [Support KCP Protocol](#support-kcp-protocol)
* [Connection Pool](#connection-pool)
* [Load balancing](#load-balancing)
* [Health Check](#health-check)
* [Rewriting the Host Header](#rewriting-the-host-header)
* [Set Headers In HTTP Request](#set-headers-in-http-request)
* [Get Real IP](#get-real-ip)
Expand All @@ -54,11 +57,6 @@ frp is a fast reverse proxy to help you expose a local server behind a NAT or fi

<!-- vim-markdown-toc -->

## What can I do with frp?

* 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).
* Expose any tcp or udp service behind a NAT or firewall to the internet by a server with public IP address.

## 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 Down Expand Up @@ -345,6 +343,34 @@ You can find features which this document not metioned from full example configu

[frpc full configuration file](./conf/frpc_full.ini)

### Configuration file template

Configuration file tempalte can be rendered using os environments. Template uses Go's standard format.

```ini
# frpc.ini
[common]
server_addr = {{ .Envs.FRP_SERVER_ADDR }}
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = {{ .Envs.FRP_SSH_REMOTE_PORT }}
```

Start frpc program:

```
export FRP_SERVER_ADDR="x.x.x.x"
export FRP_SSH_REMOTE_PORT="6000"
./frpc -c ./frpc.ini
```

frpc will auto render configuration file template using os environments.
All environments has prefix `.Envs`.

### Dashboard

Check frp's status and proxies's statistics information by Dashboard.
Expand All @@ -365,11 +391,7 @@ Then visit `http://[server_addr]:7500` to see dashboard, default username and pa

### Authentication

Since v0.10.0, you only need to set `token` in frps.ini and frpc.ini.

Note that time duration between server of frpc and frps mustn't exceed 15 minutes because timestamp is used for authentication.

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.
`token` in frps.ini and frpc.ini should be same.

### Encryption and Compression

Expand Down Expand Up @@ -511,6 +533,52 @@ group_key = 123

Proxies in same group will accept connections from port 80 randomly.

### Health Check

Health check feature can help you achieve high availability with load balancing.

Add `health_check_type = {type}` to enable health check.

**type** can be tcp or http.

Type tcp will dial the service port and type http will send a http rquest to service and require a 200 response.

Type tcp configuration:

```ini
# frpc.ini
[test1]
type = tcp
local_port = 22
remote_port = 6000
# enable tcp health check
health_check_type = tcp
# dial timeout seconds
health_check_timeout_s = 3
# if continuous failed in 3 times, the proxy will be removed from frps
health_check_max_failed = 3
# every 10 seconds will do a health check
health_check_interval_s = 10
```

Type http configuration:
```ini
# frpc.ini
[web]
type = http
local_ip = 127.0.0.1
local_port = 80
custom_domains = test.yourdomain.com
# enable http health check
health_check_type = http
# frpc will send a GET http request '/status' to local http service
# http service is alive when it return 2xx http response code
health_check_url = /status
health_check_interval_s = 10
health_check_max_failed = 3
health_check_timeout_s = 3
```

### Rewriting the Host Header

When forwarding to a local port, frp does not modify the tunneled HTTP requests at all, they are copied to your server byte-for-byte as they are received. Some application servers use the Host header for determining which development site to display. For this reason, frp can rewrite your requests with a modified host header. Use the `host_header_rewrite` switch to rewrite incoming HTTP requests.
Expand Down Expand Up @@ -549,8 +617,6 @@ Features for http proxy only.

You can get user's real IP from http request header `X-Forwarded-For` and `X-Real-IP`.

**Note that now you can only get these two headers in first request of each user connection.**

### Password protecting your web service

Anyone who can guess your tunnel URL can access your local web server unless you protect it with a password.
Expand Down
Loading

0 comments on commit 649a2f2

Please sign in to comment.