Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onley support unix system build? #1

Closed
kitty-eu-org opened this issue Dec 16, 2023 · 17 comments
Closed

Onley support unix system build? #1

kitty-eu-org opened this issue Dec 16, 2023 · 17 comments

Comments

@kitty-eu-org
Copy link

Onley support unix system build?

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

Yeah.

@kitty-eu-org
Copy link
Author

Yeah.

Thank you very much for your contribution so that I can use it quickly. Can it be supported on mobile?

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

@kitty-eu-org
Copy link
Author

https://github.com/heiher/hev-socks5-tunnel#use-cases

i build it ,but it can't work:

[2023-12-16 22:02:37] [D] socks5 tunnel init
[2023-12-16 22:02:37] [E] socks5 tunnel open

Are there any other error messages? I don't know what happened?

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

Which system do you use?

@kitty-eu-org
Copy link
Author

kitty-eu-org commented Dec 16, 2023

Which system do you use?

wsl, ubuntu22.04

@kitty-eu-org
Copy link
Author

I currently want to write a cross-platform gfw software. I want to use this project to implement tun2socks, so both iOS and Android may want it. Also, let me ask, boss, are you Chinese?

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

No problem. I believe it can works well on Android and iOS. (I'm Chinese.

@kitty-eu-org
Copy link
Author

No problem. I believe it can works well on Android and iOS. (I'm Chinese.

I try in wsl ubuntu 22.04:

git clone --recursive https://github.com/heiher/hev-socks5-tunnel
cd hev-socks5-tunnel
make

but it not work, error is :

[2023-12-16 22:02:37] [D] socks5 tunnel init
[2023-12-16 22:02:37] [E] socks5 tunnel open

I do not know why。 What is the possible reason for this?

I am a chinese too.

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

据我所知,WSL不支持Linux Tun/Tap功能。不知道WSL2现在是否能支持。不过就算可以的话,估计也不能在WSL里捕获Windows的网络流量吧。如果你有Linux的路由器,我认为跑在网关上是个不错的选择。

@kitty-eu-org
Copy link
Author

据我所知,WSL不支持Linux Tun/Tap功能。不知道WSL2现在是否能支持。不过就算可以的话,估计也不能在WSL里捕获Windows的网络流量吧。如果你有Linux的路由器,我认为跑在网关上是个不错的选择。

忘记说了我用的是wsl2.。。。意思就是wsl2里面的ubuntu2不能用吗?
我看了wsl的issue:
microsoft/WSL#874
貌似好像可以用?
wsl2 ubuntu22.04好像是有tun的?
image

@kitty-eu-org
Copy link
Author

kitty-eu-org commented Dec 16, 2023

另外我想知道如何获取更多的错误信息:
[2023-12-16 22:02:37] [D] socks5 tunnel init
[2023-12-16 22:02:37] [E] socks5 tunnel open
我已经开了debug模式的日志了,但是这个错误信息太少了

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

我刚实测了一下,确认WSL2是可以跑的,并且功能正常。只是只能路由Linux的流量,而不包含Widows的。你遇到的问题很可能是没有使用root用户运行或增加sudo前辍。

@kitty-eu-org
Copy link
Author

我刚实测了一下,确认WSL2是可以跑的,并且功能正常。只是只能路由Linux的流量,而不包含Widows的。你遇到的问题很可能是没有使用root用户运行或增加sudo前辍。
好的,我试试,没提示,我也不知道为啥错了,哈哈哈

@kitty-eu-org
Copy link
Author

我刚实测了一下,确认WSL2是可以跑的,并且功能正常。只是只能路由Linux的流量,而不包含Widows的。你遇到的问题很可能是没有使用root用户运行或增加sudo前辍。
好的,我试试,没提示,我也不知道为啥错了,哈哈哈

我刚试了一下,确实可以跑哦,谢谢大佬

@heiher
Copy link
Owner

heiher commented Dec 16, 2023

在WSL2中使用tun2socks代理Windows的流量也是可以的,比如IPv4以1.1.1.1为例这样配置:

WSL2 (IP 172.28.160.215):

sudo sysctl -w net.ipv4.ip_forward=1
sudo hev-socks5-tunnel main.yml
sudo ip route add 1.1.1.1 dev tun0

Windows (IP 172.28.160.1):

route add 1.1.1.1 mask 255.255.255.255 172.28.160.215 metric 1

@kitty-eu-org
Copy link
Author

在WSL2中使用tun2socks代理Windows的流量也是可以的,比如IPv4以1.1.1.1为例这样配置:

WSL2 (IP 172.28.160.215):

sudo sysctl -w net.ipv4.ip_forward=1
sudo hev-socks5-tunnel main.yml
sudo ip route add 1.1.1.1 dev tun0

Windows (IP 172.28.160.1):

route add 1.1.1.1 mask 255.255.255.255 172.28.160.215 metric 1

ok,谢谢大佬,我确实是个tun2socks的新手,刚忘记了tun需要root权限或者管理员权限才能开启

@heiher heiher closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants