Coder Social home page Coder Social logo

liudf0716 / xfrpc Goto Github PK

View Code? Open in Web Editor NEW
683.0 11.0 84.0 7.36 MB

The xfrpc project is a lightweight implementation of the FRP client written in C language for OpenWRT and IoT systems. It is designed to provide an efficient solution for resource-constrained devices such as OpenWRT routers and IoT devices, which often have limited ROM and RAM space.

License: GNU General Public License v3.0

CMake 5.04% C 86.55% Dockerfile 0.05% Makefile 0.03% Jupyter Notebook 0.47% C++ 7.86%
frp reverse-proxy openwrt lan-proxy colab github-actions instaloader

xfrpc's Introduction

xfrpc

What is xfrpc

The xfrpc project is an implementation of frp client written in C language for OpenWRT and IOT system. The main motivation of this project is to provide a lightweight solution for devices with limited resources such as OpenWRT devices which often have limited ROM and RAM space. The project aims to provide a frp client that uses less space and memory than other available options.

Development Status

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

the following table is detail compatible feature:

Feature xfrpc frpc
tcp Yes Yes
tcpmux Yes Yes
http Yes Yes
https Yes Yes
custom_domains Yes Yes
subdomain Yes Yes
socks5 Yes No
use_encryption No Yes
use_compression No Yes
udp No Yes
p2p No Yes
xtcp No Yes
stcp No Yes

Architecture

Architecture

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
  

How to build

Build on Ubuntu 20.04.3 LTS

To run xfrpc on Ubuntu 20.04 LTS, you will need to have the following libraries installed: libevent, openssl-dev, and json-c. Use the following command in your terminal to install these libraries:

sudo apt-get update
sudo apt-get install -y libjson-c-dev libevent-dev libssl-dev

Once the required libraries are installed, you can download the xfrpc source code by forking the xfrpc repository on GitHub and then cloning it to your local machine using the following command:

git clone https://github.com/${YOUR_GITHUB_ACCOUNT_NAME}/xfrpc.git

Navigate to the xfrp directory and create a build directory by using these commands:

cd xfrp
mkdir build

Use the following commands to build and install xfrpc:

cmake ..
make

This will compile xfrpc and create an executable in the build directory. You can then run xfrpc using the executable by running the appropriate command in terminal.

Build xfrpc by Built-in thirdparty

use Built-in thirdparty build xfrpc.

require cmake version > 3.1.

To build xfrpc using the built-in third-party libraries, you can fork the xfrpc repository on GitHub and then clone it locally. Then, navigate to the xfrp directory, create a build directory, and use cmake to configure the build.

git clone https://github.com/${YOUR_GITHUB_ACCOUNT_NAME}/xfrpc.git
cd xfrp
mkdir build
cmake -D THIRDPARTY_STATIC_BUILD=ON ..
make

By setting THIRDPARTY_STATIC_BUILD=ON the build process will use the libraries that are included in the xfrpc source code, instead of using the libraries installed on your system.

The THIRDPARTY_STATIC_BUILD parameter is default set to OFF, which means that by default the build process will use the libraries installed on your system.

It's important to note that you will need cmake version greater than 3.1 to use this feature.

Cross-compile xfrpc by Built-in thirdparty

The method of compiling arm architecture or mips architecture xfrpc under x86 architecture is as follows.

Test on Ubuntu 22.04 LTS

Cross-compile mips architecture xfrpc(only support linux mips, irix mips don't supported) If can't run in special mips architecture, Modify the CMakeLists.txt in the thirdparty folder and change the linux-mips32 string to linux-generic32.After modify can work.

sudo apt-get install gcc-mips-linux-gnu # install mips-gcc compiler
mkdir build && cd build
cmake -DTHIRDPARTY_STATIC_BUILD=mips -DCMAKE_C_COMPILER=mips-linux-gnu-gcc ..
make

CMAKE_C_COMPILER flag is the path of your cross compiler.I recommend that you put this in an environment variable.

Cross-compile arm architecture xfrpc

sudo apt-get install arm-linux-gnueabihf-gcc
mkdir build && cd build
cmake -DTHIRDPARTY_STATIC_BUILD=arm -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc ..
make

Build static binary in Alpine container

Under project root directory

$ DOCKER_BUILDKIT=1 docker build --output out . -f docker/Dockerfile

$ ls out/
xfrpc

Build on OpenWrt master

xfrpc is included in the OpenWrt community since version 1.04.515, which allows users to easily include it in their custom firmware images. It is recommended to use the latest version of xfrpc as it may have bug fixes and new features.

To include xfrpc in your OpenWrt firmware image, you can use the make menuconfig command to open the configuration menu. In the menu, navigate to "Network" and select "Web Servers/Proxies" and then select xfrpc. This will include xfrpc in the firmware image that will be built.

Build xfrpc with asan(For detect memory leak)

When encountering a segment fault, please use the following command to compile xfrpc:

cmake -DCMAKE_BUILD_TYPE=Debug ..

Now your xfrpc can detect memory leak.We will add it in ci flow in future.

Quick start for use

before using xfrpc, you should get frps server: frps

frps is a server-side component of the FRP (Fast Reverse Proxy) system and it is used to forward incoming connections to xfrpc.

  • frps

To run frps, you can use the following command, providing it with the path to the frps configuration file:

./frps -c frps.ini

A sample frps.ini configuration file is provided in the example, which binds frps to listen on port 7000.

# frps.ini
[common]
bind_port = 7000
  • xfrpc tcp support

xfrpc is a client-side component of the FRP system and it can be used to forward TCP connections. To forward incoming TCP connections to a local service, you can configure xfrpc with the following example in xfrpc_mini.ini file

#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

This configuration tells the frp server (frps) to forward incoming connections on remote port 6128 to the xfrpc client. The xfrpc client, in turn, will forward these connections to the local service running on IP address 127.0.0.1 and port 22.

  • xfrpc http&https support

Supporting HTTP and HTTPS in xfrpc requires additional configuration compared to supporting just TCP. In the frps.ini configuration file, the vhost_http_port and vhost_https_port options must be added to specify the ports that the frp server (frps) will listen on for incoming HTTP and HTTPS connections.

# frps.ini
[common]
bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443

It is important to ensure that the xfrpc client is properly configured to communicate with the frp server by specifying the correct server address and port in the xfrpc configuration file.

# xfrpc_mini.ini 
[common]
server_addr = x.x.x.x
server_port = 7000

[http]
type = http
local_port = 80
local_ip = 127.0.0.1
custom_domains = www.example.com

[https]
type = https
local_port = 443
local_ip = 127.0.0.1
custom_domains = www.example.com

The FRP server (frps) will forward incoming HTTP and HTTPS connections to the domain "www.example.com" to the location where xfrpc is running on the local IP and port specified in the configuration file (127.0.0.1:80 and 127.0.0.1:443 respectively).

It is important to note that the domain name "www.example.com" should be pointed to the public IP address of the FRP server (frps) so that when a user's HTTP and HTTPS connections visit the domain, the FRP server can forward those connections to the xfrpc client. This can be done by configuring a DNS server or by using a dynamic DNS service.

  • Run in debug mode

In order to troubleshooting problem when run xfrpc, you can use debug mode. which has more information when running.

xfrpc -c frpc_mini.ini -f -d 7 
  • Run in release mode :
xfrpc -c frpc_mini.ini -d 0

It is important to note that running xfrpc in release mode will generate less log output and will run faster than in debug mode, so it is the recommended way to run xfrpc in production environment.

Openwrt luci configure ui

If you're running xfrpc on an OpenWRT device, luci-app-xfrpc is a good option to use as it provides a web-based interface for configuring and managing xfrpc. luci-app-xfrpc is a module for the LuCI web interface, which is the default web interface for OpenWRT.

luci-app-xfrpc was adopted by the LuCI project, which is the official web interface for OpenWRT. This means that it is a supported and well-maintained option for managing xfrpc on OpenWRT devices.

luci-app-xfrpc can be installed via the opkg package manager on OpenWRT and provides a user-friendly interface for configuring the xfrpc client, including options for setting up multiple connections, custom domains and more.

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

Star History Chart

打赏

支付宝打赏

支付宝打赏

微信打赏

微信打赏

xfrpc's People

Contributors

apcoin avatar gigibox avatar helintongh avatar jimlee1996 avatar kerwinkoo avatar liudf0716 avatar liuxc0116 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xfrpc's Issues

远程连接关闭后, 本地连接还是会保持连接

1.跟远程的连接关闭后,xfrpc跟本地的连接不关闭,会导致xfrpc跟本地服务的连接数不断增加
2.关闭跟frps端口的连接, 在收到FIN标记的包后, 修改标记close_stream = 1, 可以关闭链接,但是接收到的数据没能完成写入本地服务

理想状态下,应该是 1.发送完数据给frps的转发端口 2.跟frps的端口断开连接 3.xfrpc写入数据给本地服务 4.如果远程服务断开了, 则关闭跟本地服务的链接

Web上上传任意文件都会触发tcpmux逻辑退出

xfrpc是个很好的项目,最近测试时发现了一些问题

tcp通道访问网页时,网页访问都是正常的,但任何上传文件的操作都会导致xfrpc崩溃
错误提示
[6][Thu Oct 27 10:59:05 2022]29122 !!!!!type is DATA but cant find stream_id : type [data] flag [zero] stream_id[0]

这里的逻辑直接return 0的话,上传可以完成,但会导致后续请求死循环
[6][Thu Oct 27 10:52:25 2022]27907 enc_msg length should not be 0

服务端版本是frps 0.42.0

SCTP mode supported

xfrpc currently does not support STCP, and we are in need of assistance to implement it. As stated in the frp documentation, 'STCP' is described as:

Expose your service privately
Some services will be at risk if exposed directly to the public network. With STCP (secret TCP) mode, a preshared key is needed to access the service from another client.

Configure frps same as above.

Start frpc on machine B with the following config. This example is for exposing the SSH service (port 22), and note the sk field for the preshared key, and that the remote_port field is removed here:

frpc.ini

[common]
server_addr = x.x.x.x
server_port = 7000

[secret_ssh]
type = stcp
sk = abcdefg
local_ip = 127.0.0.1
local_port = 22
Start another frpc (typically on another machine C) with the following config to access the SSH service with a security key (sk field):

frpc.ini

[common]
server_addr = x.x.x.x
server_port = 7000

[secret_ssh_visitor]
type = stcp
role = visitor
server_name = secret_ssh
sk = abcdefg
bind_addr = 127.0.0.1
bind_port = 6000
On machine C, connect to SSH on machine B, using this command:
ssh -oPort=6000 127.0.0.1

期望支持iot 系统

iot系统大部分是rtos,采用c编程,如freertos、contiki、Alios Things、Huawei LiteOS、RT-Thread,跑是轻量tcp/ip协议栈如lwip/uip,基本兼容linux 标准socket api。看了下xfrpc的代码,目前只支持linux,代码socket采用libevent并柔和在代码中,若想支持iot系统,必须把这部分抽象出来重构,其他小改即可支持

另外考虑下场景应用,iot产品大部分是低速率通信,frp协议是否适用

Compiling in THIRDPARTY_STATIC_BUILD mode fails to link

It's the compiling step:

  1. fork project and compile
git clone https://github.com/${YOUR_GITHUB_ACCOUNT_NAME}/xfrpc.git
cd xfrp
mkdir build
cmake -D THIRDPARTY_STATIC_BUILD=ON ..
make
  1. at the link stage, the error 'undefined reference to `arc4random' is encountered
[  5%] Building C object CMakeFiles/xfrpc.dir/main.c.o
[ 10%] Building C object CMakeFiles/xfrpc.dir/client.c.o
[ 15%] Building C object CMakeFiles/xfrpc.dir/config.c.o
[ 20%] Building C object CMakeFiles/xfrpc.dir/control.c.o
[ 25%] Building C object CMakeFiles/xfrpc.dir/ini.c.o
[ 30%] Building C object CMakeFiles/xfrpc.dir/msg.c.o
[ 35%] Building C object CMakeFiles/xfrpc.dir/xfrpc.c.o
[ 40%] Building C object CMakeFiles/xfrpc.dir/debug.c.o
[ 45%] Building C object CMakeFiles/xfrpc.dir/zip.c.o
[ 50%] Building C object CMakeFiles/xfrpc.dir/commandline.c.o
[ 55%] Building C object CMakeFiles/xfrpc.dir/crypto.c.o
[ 60%] Building C object CMakeFiles/xfrpc.dir/fastpbkdf2.c.o
[ 65%] Building C object CMakeFiles/xfrpc.dir/utils.c.o
[ 70%] Building C object CMakeFiles/xfrpc.dir/common.c.o
[ 75%] Building C object CMakeFiles/xfrpc.dir/login.c.o
[ 80%] Building C object CMakeFiles/xfrpc.dir/proxy_tcp.c.o
[ 85%] Building C object CMakeFiles/xfrpc.dir/proxy_ftp.c.o
[ 90%] Building C object CMakeFiles/xfrpc.dir/proxy.c.o
[ 95%] Building C object CMakeFiles/xfrpc.dir/tcpmux.c.o
[100%] Linking C executable xfrpc
/usr/bin/ld: /workspaces/codespaces-blank/xfrpc/thirdparty/libs/libjson-c.a(random_seed.c.o): in function `json_c_get_random_seed':
/workspaces/codespaces-blank/xfrpc/thirdparty/json-c/random_seed.c:331: undefined reference to `arc4random'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xfrpc.dir/build.make:354: xfrpc] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/xfrpc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

A 32bit cpu incompatibility problem about timestamp.

struct login {
	char		*version;
	char		*hostname;
	char 		*os;
	char		*arch;
	char 		*user;
	char 		*privilege_key;
	long int 	timestamp;
	char 		*run_id;
	char		*metas;
	int 		pool_count;

	/* fields not need json marshal */
	int			logged;		//0 not login 1:logged
};

在login.h文件中的结构体login 中的timestamp成员定义为long int类型,在32位架构CPU中,该类型为4 bytes。在msg.c文件的login_request_marshal函数中调用JSON_MARSHAL_TYPE(j_login_req, "timestamp", int64, lg->timestamp);。int64类型是8 bytes。存在兼容性问题。
建议使用time_t类型,然后根据sizeof(time_t)来选择传入的是int64还是int。cJOSN就做的很好,直接使用double存所有的数字。

连接frps出错,“type incorrect: it should be login response, but 124”

编译和运行环境:Ubuntu 18.04.6 LTS
[7][Fri Feb 2 19:04:22 2024]29772 Reading configuration file 'xfrpc_mini.ini'
[7][Fri Feb 2 19:04:22 2024]29772 Section[common]: {server_addr:127.0.0.1, server_port:7993, auth_token:(null), interval:30, timeout:90}
[7][Fri Feb 2 19:04:22 2024]29772 Proxy service 0: {name:ssh, local_port:22, type:tcp, use_encryption:0, use_compression:0, custom_domains:(null), subdomain:(null), locations:(null), host_header_rewrite:(null), http_user:(null), http_pwd:(null)}
[6][Fri Feb 2 19:04:22 2024]29772 connect server [127.0.0.1:7993]...
[7][Fri Feb 2 19:04:22 2024]29772 xfrp server connected
[7][Fri Feb 2 19:04:22 2024]29772 send plain msg ----> [o: { "version": "0.43.0", "hostname": "", "os": "Linux", "arch": "x86_64", "user": "", "privilege_key": "df256a7763a32c0ea63c595ee36efb88", "timestamp": 1706871862, "run_id": "525400687ED2", "pool_count": 1, "metas": null }]
[7][Fri Feb 2 19:04:22 2024]29772 start keep_control_alive
[3][Fri Feb 2 19:04:22 2024]29772 type incorrect: it should be login response, but 124
[3][Fri Feb 2 19:04:22 2024]29772 type incorrect: it should be login response, but -28

1.11.587版本内存占用会不断增加

编译测试了x86_64和arm下的版本,都存在内存不断增加的情况,应该有明显的内存泄露

初始内存情况:3848K
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1525 vlinker 20 0 16404 3848 3444 S 0.0 0.0 0:00.00 xfrpc

刷新一次网页后:内存升到6.8M
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1525 vlinker 20 0 19352 6808 3444 S 0.0 0.0 0:00.15 xfrpc

刷新第五次以后,内存升到17M
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1525 vlinker 20 0 29384 16840 3444 S 0.0 0.1 0:00.73 xfrpc

继续刷新网页内存很快就可以突破100M,停止访问后内存不会下降

补充其他依赖版本号:
libevent-2.1.12-stable.tar.gz
json-c-json-c-0.16-20220414.tar.gz
openssl-1.1.1s.tar.gz

Risk of segment errors at start_work_conn_resp_unmarshal function

我使用的是2.9.644版本的xfrpc。
start_work_conn_resp_unmarshal函数内部,在proxy_name解析失败时,仍然返回sr有效指针,此时sr->proxy_name为NULL。接下来struct proxy_service *ps = get_proxy_service(sr->proxy_name);代码处直接使用sr->proxy_name变量,发生段错误。
上述是我真实发生段错误后,追踪到的路径。可以查看一下代码。

下面是我添加打印后的日志:
注释 get_proxy_service(sr->proxy_name);,后的打印日志。
[7][Wed Oct 25 14:39:28 2023]23385 I AM HERE!!
[7][Wed Oct 25 14:39:28 2023]23385 I AM HERE!!
[3][Wed Oct 25 14:39:28 2023]23385 TypeStartWorkConn requested proxy service [NULL] not found, it should nerver be happend!
[7][Wed Oct 25 14:39:28 2023]23385 I AM HERE!!
[7][Wed Oct 25 14:39:28 2023]23385 main control message

在start_work_conn_resp_unmarshal内部添加打印,并修改逻辑后的打印。
[7][Wed Oct 25 14:48:30 2023]6206 start work conn resp unmarshal msg:{"error":"token in NewWorkConn doesn't match token from configuration"}
[3][Wed Oct 25 14:48:30 2023]6206 start work conn resp unmarshal msg proxy_name NULL, {"error":"token in NewWorkConn doesn't match token from configuration"}
[3][Wed Oct 25 14:48:30 2023]6206 TypeStartWorkConn unmarshal failed, it should never be happend!

Support to compile it static

Hi,

This project targets OpenWRT devices. However, it could be useful to run it in other devices. In this case, the only one requirement is that the binary will be static. Therefore, the question is: how to compile the target static?

Regards.

类型为tcpmux会出现不支持的情况

将配置文件中的type为tcpmux时会出现proxy service type tcpmux is not supportted.

查看readme是发现支持的,采用最新版的源码,交叉编译到padavan中使用。pdavan内核版本3.4.x
配置如下:
image

token不匹配

如下图,确认服务端和客户端token是一致的,但提示不匹配。把双端的token临时注释掉就可以连上,是bug么?
version: 1.05.579
image

Is it possible to drop libevent2-openssl dependence?

Thank you for your great work!
Xfrpc reduce the size of frpc so that I can use it on my small flash route.

Is it possible to drop libevent2-openssl dependence if I am not using any https related function.
libopenssl is big, I 'd like to replace it with libmbedtls, but I can find a libevent2-mbedtl package for xfrpc.

Thanks

Segmentation fault in http mode

Running on k2p padavan
xfrpc: 2.1.606

config:

[common]
server_addr = 192.168.2.2
server_port = 7000
token = ***

[Router-747d245360cd]
type = http
local_port = 80
custom_domains = 747d245360cd.frp.example.com

logs:

K2P:/tmp # ./xfrpc -c /etc/storage/frpc.ini -f -d 7
[7][Mon Jan 23 16:01:48 2023][6940](config.c:328) Reading configuration file '/etc/storage/frpc.ini'
[7][Mon Jan 23 16:01:48 2023][6940](config.c:95) Section[common]: {server_addr:192.168.2.2, server_port:7000, auth_token:***, interval:30, timeout:90}
[7][Mon Jan 23 16:01:48 2023][6940](config.c:120) Proxy service 0: {name:Router-747d245360cd, local_port:80, type:http}
[7][Mon Jan 23 16:01:48 2023][6940](login.c:104) working in router
[6][Mon Jan 23 16:01:48 2023][6940](control.c:653) connect server [192.168.2.2:7000]...
[7][Mon Jan 23 16:01:48 2023][6940](control.c:615) xfrp server connected
[7][Mon Jan 23 16:01:48 2023][6940](control.c:690) send plain msg ----> [o: { "version": "0.43.0", "hostname": "", "os": "Linux", "arch": "mips", "user": "", "privilege_key": "0f35985cc07ead44460f1a54f37ce1de", "timestamp": 1674460908, "run_id": "747D245360CD", "pool_count": 1, "metas": null }]
[7][Mon Jan 23 16:01:48 2023][6940](control.c:627) start keep_control_alive
[7][Mon Jan 23 16:01:48 2023][6940](login.c:129) xfrp login response: run_id: [747D245360CD], version: [0.45.0]
[3][Mon Jan 23 16:01:48 2023][6940](control.c:445) login success! login_len 67 len 76 ilen 0
[7][Mon Jan 23 16:01:48 2023][6940](control.c:317) recv eas1238 iv data
[6][Mon Jan 23 16:01:48 2023][6940](control.c:159) Start xfrp proxy services ...
[7][Mon Jan 23 16:01:48 2023][6940](control.c:790) control proxy client: [Type 112 : proxy_name Router-747d245360cd : msg_len 279]
[7][Mon Jan 23 16:01:48 2023][6940](control.c:128) new client through tcp mux: 5
[7][Mon Jan 23 16:01:48 2023][6940](control.c:690) send plain msg ----> [w: { "run_id": "747D245360CD" }]

.........

[7][Mon Jan 23 16:08:46 2023][6997](client.c:182) free client 103
[7][Mon Jan 23 16:08:46 2023][6997](control.c:398) proxy service [Router-747d245360cd] [(null):80] start work connection. remain data length 0
[7][Mon Jan 23 16:08:46 2023][6997](client.c:137) proxy server [192.168.2.2:-1] <---> client [127.0.0.1:80]
[7][Mon Jan 23 16:08:46 2023][6997](client.c:78) what [128] client [105] connected : Operation now in progress
[7][Mon Jan 23 16:08:46 2023][6997](control.c:128) new client through tcp mux: 113
[7][Mon Jan 23 16:08:46 2023][6997](control.c:690) send plain msg ----> [w: { "run_id": "747D245360CD" }]
[7][Mon Jan 23 16:08:46 2023][6997](control.c:128) new client through tcp mux: 115
[7][Mon Jan 23 16:08:46 2023][6997](control.c:690) send plain msg ----> [w: { "run_id": "747D245360CD" }]
[7][Mon Jan 23 16:08:46 2023][6997](control.c:398) proxy service [Router-747d245360cd] [(null):80] start work connection. remain data length 0
[7][Mon Jan 23 16:08:46 2023][6997](client.c:137) proxy server [192.168.2.2:-1] <---> client [127.0.0.1:80]
[7][Mon Jan 23 16:08:46 2023][6997](client.c:78) what [128] client [107] connected : Operation now in progress
[7][Mon Jan 23 16:08:46 2023][6997](client.c:72) xfrpc proxy close connect server [(null):80] stream_id 107: Operation now in progress
[7][Mon Jan 23 16:08:46 2023][6997](tcpmux.c:266) free stream 107
[7][Mon Jan 23 16:08:46 2023][6997](client.c:182) free client 107
[7][Mon Jan 23 16:08:46 2023][6997](client.c:72) xfrpc proxy close connect server [(null):80] stream_id 105: Operation now in progress
[7][Mon Jan 23 16:08:46 2023][6997](tcpmux.c:266) free stream 105
[7][Mon Jan 23 16:08:46 2023][6997](client.c:182) free client 105
Segmentation fault

How to compile in docker to different architecture?

Hi,

Now we can compile xfrpc inside a container with static support. However, I need to know how to compile not only for x86, but for example ARM for Android device, mips32 for OpenWRT device, etc.

Any idea?

forward TCP port to http proxy or socks5 server "Segmentation fault" when using wrong pwd

In Openwrt 22.03 , xfrpc - 2.1.606-1,
system type : MediaTek MT7620A
CPU model : MIPS 24KEc V5.0

# frpc.ini
[common]
server_addr = mydomain.xxx
server_port = 37219
token = xxxxxx
user = test
protocol = tcp
tls_enable = true
[socks5-test]
type = tcp
local_ip = 127.0.0.1
local_port = 1080
remote_port = 31080

run it /usr/bin/xfrpc -c frpc.ini

127.0.0.1:1080 is a local socks5 service that requires account authentication.

"frps-0.42.0" is running in my Debian system (x86_64).

I use ssh with ProxyCommand ncat --proxy-type socks5 --proxy 127.0.0.1:31080 --proxy-auth usr:12345 %h %p connect to the remote server,
If wrong password used, xfrpc crashes with "Segmentation fault".

I change 127.0.0.1:1080 to http proxy.
I use ssh with ProxyCommand ncat --proxy-type http --proxy 127.0.0.1:31080 --proxy-auth usr:12345 %h %p connect to the remote server,
If wrong password used, xfrpc crashes with "Segmentation fault".

If use correct password for socks5 or http proxy.
xfrpc works fine.

$ ncat -v
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: You must specify a host to connect to. QUITTING.

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.