Skip to content

feat: support Windows TUN mode #102

Open
kitty-eu-org wants to merge 5 commits intocfal:masterfrom
kitty-eu-org:pr-win-tun
Open

feat: support Windows TUN mode #102
kitty-eu-org wants to merge 5 commits intocfal:masterfrom
kitty-eu-org:pr-win-tun

Conversation

@kitty-eu-org
Copy link

Added TUN mode support for Windows to enable transparent proxying. This implementation covers interface creation and basic routing setup.

@happytrudy
Copy link

Has there been any progress on this issue?

Copy link
Owner

@cfal cfal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this PR was mainly written by AI without quite understanding the consequences - and i can't tell whether the tun changes are correct and if they break anything on Linux which was just recently fixed. I'm curious if the entire event loop in run_tun_server actually needs to be changed to support Windows.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for rename?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tun-rs library now supports asynchronous mode, so I want to convert all the code to be uniformly asynchronous. Additionally, Windows does not support file descriptors (fd), so I implemented a VirtTunDeviceand channel by referring to the implementation in shadowsocks-rust. This unavoidably leads to substantial changes to your original code.

@kitty-eu-org
Copy link
Author

i think this PR was mainly written by AI without quite understanding the consequences - and i can't tell whether the tun changes are correct and if they break anything on Linux which was just recently fixed. I'm curious if the entire event loop in run_tun_server actually needs to be changed to support Windows.

I have indeed used AI to write a lot of code, but I have tested it on Windows and confirmed that tun works properly. It has also been tested on Linux and works correctly

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

Successfully merging this pull request may close these issues.

3 participants