# frp
[![Build Status](https://circleci.com/gh/fatedier/frp.svg?style=shield)](https://circleci.com/gh/fatedier/frp)
[![GitHub release](https://img.shields.io/github/tag/fatedier/frp.svg?label=release)](https://github.com/fatedier/frp/releases)
[README](README.md) | [中文文档](README_zh.md)
## What is frp?
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** and **UDP**, as well as **HTTP** and **HTTPS** protocols, where requests can be forwarded to internal services by domain name.
frp also has a P2P connect mode.
## Table of Contents
<!-- vim-markdown-toc GFM -->
* [Development Status](#development-status)
* [Architecture](#architecture)
* [Example Usage](#example-usage)
* [Access your computer in LAN by SSH](#access-your-computer-in-lan-by-ssh)
* [Visit your web service in LAN by custom domains](#visit-your-web-service-in-lan-by-custom-domains)
* [Forward DNS query request](#forward-dns-query-request)
* [Forward Unix domain socket](#forward-unix-domain-socket)
* [Expose a simple HTTP file server](#expose-a-simple-http-file-server)
* [Enable HTTPS for local HTTP service](#enable-https-for-local-http-service)
* [Expose your service privately](#expose-your-service-privately)
* [P2P Mode](#p2p-mode)
* [Features](#features)
* [Configuration Files](#configuration-files)
* [Using Environment Variables](#using-environment-variables)
* [Dashboard](#dashboard)
* [Admin UI](#admin-ui)
* [Monitor](#monitor)
* [Prometheus](#prometheus)
* [Authenticating the Client](#authenticating-the-client)
* [Token Authentication](#token-authentication)
* [OIDC Authentication](#oidc-authentication)
* [Encryption and Compression](#encryption-and-compression)
* [TLS](#tls)
* [Hot-Reloading frpc configuration](#hot-reloading-frpc-configuration)
* [Get proxy status from client](#get-proxy-status-from-client)
* [Only allowing certain ports on the server](#only-allowing-certain-ports-on-the-server)
* [Port Reuse](#port-reuse)
* [Bandwidth Limit](#bandwidth-limit)
* [For Each Proxy](#for-each-proxy)
* [TCP Stream Multiplexing](#tcp-stream-multiplexing)
* [Support KCP Protocol](#support-kcp-protocol)
* [Connection Pooling](#connection-pooling)
* [Load balancing](#load-balancing)
* [Service Health Check](#service-health-check)
* [Rewriting the HTTP Host Header](#rewriting-the-http-host-header)
* [Setting other HTTP Headers](#setting-other-http-headers)
* [Get Real IP](#get-real-ip)
* [HTTP X-Forwarded-For](#http-x-forwarded-for)
* [Proxy Protocol](#proxy-protocol)
* [Require HTTP Basic Auth (Password) for Web Services](#require-http-basic-auth-password-for-web-services)
* [Custom Subdomain Names](#custom-subdomain-names)
* [URL Routing](#url-routing)
* [TCP Port Multiplexing](#tcp-port-multiplexing)
* [Connecting to frps via HTTP PROXY](#connecting-to-frps-via-http-proxy)
* [Range ports mapping](#range-ports-mapping)
* [Client Plugins](#client-plugins)
* [Server Manage Plugins](#server-manage-plugins)
* [Development Plan](#development-plan)
* [Contributing](#contributing)
* [Donation](#donation)
* [AliPay](#alipay)
* [Wechat Pay](#wechat-pay)
* [PayPal](#paypal)
<!-- vim-markdown-toc -->
## Development Status
frp is under development. Try the latest release version in the `master` branch, or use the `dev` branch for the version in development.
**The protocol might change at a release and we don't promise backwards compatibility. Please check the release log when upgrading the client and the server.**
## Architecture
![architecture](/doc/pic/architecture.png)
## Example Usage
Firstly, download the latest programs from [Release](https://github.com/fatedier/frp/releases) page according to your operating system and architecture.
Put `frps` and `frps.ini` onto your server A with public IP.
Put `frpc` and `frpc.ini` onto your server B in LAN (that can't be connected from public Internet).
### Access your computer in LAN by SSH
1. Modify `frps.ini` on server A and set the `bind_port` to be connected to frp clients:
```ini
# frps.ini
[common]
bind_port = 7000
```
2. Start `frps` on server A:
`./frps -c ./frps.ini`
3. On server B, modify `frpc.ini` to put in your `frps` server public IP as `server_addr` field:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
```
Note that `local_port` (listened on client) and `remote_port` (exposed on server) are for traffic goes in/out the frp system, whereas `server_port` is used between frps.
4. Start `frpc` on server B:
`./frpc -c ./frpc.ini`
5. From another machine, SSH to server B like this (assuming that username is `test`):
`ssh -oPort=6000 test@x.x.x.x`
### Visit your web service in LAN by custom domains
Sometimes we want to expose a local web service behind a NAT network to others for testing with your own domain name and unfortunately we can't resolve a domain name to a local IP.
However, we can expose an HTTP(S) service using frp.
1. Modify `frps.ini`, set the vhost HTTP port to 8080:
```ini
# frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
```
2. Start `frps`:
`./frps -c ./frps.ini`
3. Modify `frpc.ini` and set `server_addr` to the IP address of the remote frps server. The `local_port` is the port of your web service:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[web]
type = http
local_port = 80
custom_domains = www.example.com
```
4. Start `frpc`:
`./frpc -c ./frpc.ini`
5. Resolve A record of `www.example.com` to the public IP of the remote frps server or CNAME record to your origin domain.
6. Now visit your local web service using url `http://www.example.com:8080`.
### Forward DNS query request
1. Modify `frps.ini`:
```ini
# frps.ini
[common]
bind_port = 7000
```
2. Start `frps`:
`./frps -c ./frps.ini`
3. Modify `frpc.ini` and set `server_addr` to the IP address of the remote frps server, forward DNS query request to Google Public DNS server `8.8.8.8:53`:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[dns]
type = udp
local_ip = 8.8.8.8
local_port = 53
remote_port = 6000
```
4. Start frpc:
`./frpc -c ./frpc.ini`
5. Test DNS resolution using `dig` command:
`dig @x.x.x.x -p 6000 www.google.com`
### Forward Unix domain socket
Expose a Unix domain socket (e.g. the Docker daemon socket) as TCP.
Configure `frps` same as above.
1. Start `frpc` with configuration:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[unix_domain_socket]
type = tcp
remote_port = 6000
plugin = unix_domain_socket
plugin_unix_path = /var/run/docker.sock
```
2. Test: Get Docker version using `curl`:
`curl http://x.x.x.x:6000/version`
### Expose a simple HTTP file server
Browser your files stored in the LAN, from public Internet.
Configure `frps` same as above.
1. Start `frpc` with configuration:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[test_static_file]
type = tcp
remote_port = 6000
plugin = static_file
plugin_local_path = /tmp/files
plugin_strip_prefix = static
plugin_http_user = abc
plugin_http_passwd = abc
```
2. Visit `http://x.x.x.x:6000/static/` from your browser and specify correct user and password to view files in `/tmp/files` on the `frpc` machine.
### Enable HTTPS for local HTTP(S) service
You may substitute `https2https` for the plugin, and point the `plugin_local_addr` to a HTTPS endpoint.
1. Start `frpc` with configuration:
```ini
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[test_https2http]
type = https
custom
没有合适的资源?快使用搜索试试~ 我知道了~
frpc_android:frpc_android 最新版本0.35.1
共329个文件
go:154个
xml:48个
js:15个
5星 · 超过95%的资源 需积分: 49 18 下载量 118 浏览量
2021-05-10
05:44:06
上传
评论 1
收藏 78.54MB ZIP 举报
温馨提示
是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。 当前frp版本号0.35.1 NDK version: 20.0.5594570
资源详情
资源评论
资源推荐
收起资源包目录
frpc_android:frpc_android 最新版本0.35.1 (329个子文件)
app-release.aab 20.78MB
frpclib.aar 28.28MB
frpclib.aar 28.28MB
.babelrc 260B
.babelrc 260B
gradlew.bat 2KB
Makefile.cross-compiles 3KB
Dockerfile-for-frpc 177B
Dockerfile-for-frps 177B
.gitignore 344B
.gitignore 208B
.gitignore 72B
.gitignore 72B
.gitignore 7B
statik.go 1.66MB
statik.go 997KB
proxy.go 27KB
proxy.go 19KB
reverseproxy.go 17KB
client_test.go 16KB
service.go 14KB
control.go 13KB
visitor.go 13KB
client.go 13KB
server.go 12KB
proxy_test.go 11KB
control.go 9KB
normal_test.go 9KB
dashboard_api.go 9KB
admin_api.go 9KB
proxy.go 8KB
service.go 8KB
health_test.go 7KB
server.go 7KB
root.go 7KB
visitor.go 6KB
oidc.go 6KB
udp.go 6KB
http.go 6KB
vhost.go 6KB
root.go 6KB
proxy_wrapper.go 6KB
manager.go 6KB
server_test.go 6KB
msg.go 6KB
conn.go 5KB
tcpmux.go 5KB
basic.go 5KB
http_proxy.go 5KB
https.go 5KB
tcp.go 5KB
http.go 5KB
udp.go 5KB
util.go 5KB
nathole.go 4KB
framework.go 4KB
status.go 4KB
health.go 4KB
ports.go 4KB
http.go 3KB
auth.go 3KB
https2https.go 3KB
reload_test.go 3KB
visitor_manager.go 3KB
client_server.go 3KB
stcp.go 3KB
xtcp.go 3KB
http.go 3KB
log.go 3KB
https2http.go 3KB
sudp.go 3KB
udp.go 3KB
date_counter.go 3KB
http.go 3KB
proxy_manager.go 3KB
token.go 3KB
http.go 3KB
util.go 3KB
server.go 3KB
visitor_test.go 3KB
reconnect_test.go 3KB
tcpmux.go 2KB
tcpmux.go 2KB
http2https.go 2KB
visitor.go 2KB
tls.go 2KB
expect.go 2KB
https.go 2KB
types.go 2KB
dashboard.go 2KB
e2e.go 2KB
consts.go 2KB
resource.go 2KB
http_server.go 2KB
kcp.go 2KB
server.go 2KB
xtcp.go 2KB
cmd_test.go 2KB
tcp.go 2KB
udp.go 2KB
共 329 条
- 1
- 2
- 3
- 4
斯里兰卡七七
- 粉丝: 19
- 资源: 4734
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1