Giter Club home page Giter Club logo

xfrpc's Introduction

xfrpc

What is xfrpc

xfrpc is frp client implemented by c language for OpenWRT and LEDE system

The motivation to start xfrpc project is that we are OpenWRTer, and openwrt usually ran in device which has little ROM and RAM space, however golang always need more space and memory; therefore we start xfrpc project to support frp.

Development Status

xfrpc partially compitable with latest frp release feature, It target to fully compatible with latest frp release.

the following table is detail compatible feature:

Feature xfrpc frpc
tcp Yes Yes
tcpmux No Yes
http Yes Yes
https Yes Yes
udp No Yes
p2p No Yes
xtcp No Yes
vistor No Yes

Architecture

Architecture

Architecture quote from frp project, replace frpc with xfrpc.

Sequence Diagram

sequenceDiagram
	title:	xfrpc与frps通信交互时序图
	participant 本地服务
	participant xfrpc
  participant frps
  participant 远程访问用户
  
  xfrpc ->> frps  : TypeLogin Message
  frps ->> xfrpc  : TypeLoginResp Message
  Note right of frps  : 根据Login信息里面的pool值,决定给xfrpc发送几条TypeReqWorkConn请求信息
  frps ->> xfrpc  : frps aes-128-cfb iv[16] data
  frps -->> xfrpc : TypeReqWorkConn Message
	loop 根据Login中的PoolCount创建工作连接数
  	xfrpc -->> frps  : TypeNewWorkConn Message
  	Note left of xfrpc  : 与服务器创建代理服务工作连接,并请求新的工作连接请求
  	Note right of frps  : 处理xfrpc端发送的TypeNewWorkConn消息,注册该工作连接到连接池中
  	frps ->> xfrpc  : TypeStartWorkConn Message
  	Note left of xfrpc  : 将新创建的工作连接与代理的本地服务连接做绑定
	end
  xfrpc ->> frps  : xfrpc aes-128-cfb iv[16] data
  loop 用户配置的代理服务数
  	xfrpc -->> frps : TypeNewProxy Message
  	frps -->> xfrpc : NewProxyResp Message
  end
	
  loop 心跳包检查
    xfrpc -->> frps : TypePing Message
    frps -->> xfrpc : TypePong Message
  end
  
  远程访问用户 ->> frps   : 发起访问
  frps ->> xfrpc	 : TypeStartWorkconn Message
  loop  远程访问用户与本地服务之间的交互过程
    frps ->> xfrpc         : 用户数据
    xfrpc ->> 本地服务      : 用户数据
    本地服务 ->> xfrpc      : 本地服务数据
    xfrpc ->> frps         : 本地服务数据
    frps  ->> 远程访问用户  : 本地服务数据
  end
  

Compile

xfrp need libevent openssl-dev and json-c support

Before compile xfrp, please install libevent and json-c in your system.

Install json-c libevent in ubuntu 20.04 LTS

sudo apt-get install -y libjson-c-dev
sudo apt-get install -y libevent-dev
git clone https://github.com/liudf0716/xfrpc.git
cd xfrp
mkdir build
cmake ..
make

Quick start

before using xfrpc, you should get frps server: frps

  • frps

frps use latest release 0.42.0

# frps.ini
[common]
bind_port = 7000
tcp_mux = false

run frps

./frps -c frps.ini
  • xfrpc tcp
#xfrpc_mini.ini 
[common]
server_addr = your_server_ip
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6128
  • xfrpc http
# xfrpc_mini.ini 
[common]
server_addr = x.x.x.x
server_port = 7000

[web]
type = http
local_port = 80
custom_domains = www.example.com
  • Run in debug mode
xfrpc -c frpc_mini.ini -f -d 7 
  • Run in release mode :
xfrpc -c frpc_mini.ini -d 0

How to contribute our project

See CONTRIBUTING for details on submitting patches and the contribution workflow.

Contact

QQ群 : 331230369

Please support us and star our project

广告

想学习OpenWrt开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学OpenWrt开发入门培训班助你能学有所成

报名地址:https://forgotfun.org/2018/04/openwrt-training-2018.html

xfrpc's People

Contributors

liudf0716 avatar kerwinkoo avatar gigibox avatar apcoin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.