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

add config_proxy2 for wsl2 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

xiayh17
Copy link

@xiayh17 xiayh17 commented Aug 7, 2020

Hi
Thank you for developing the zsh-proxy plugin, it is very convenient and easy to use.
I'm a User of Windows Subsystem for Linux. Recently I was planning to move to WSL2, but found the following problems of WSL2.

WSL 2 has a virtualized ethernet adapter with its own unique IP address. So WSL will have a different IP address every time it starts.
Microsoft's official reference document.

In other words, setting up a proxy for WSL cannot use 127.0.0.1 or other fixed network segments. Obtaining this dynamic IP automatically has become a key problem.
config_proxy2 option was added to solve this problem.

Thanks again!
Sincerely

@SukkaW
Copy link
Owner

SukkaW commented Aug 7, 2020

Add a config_proxy2 might be duplicated. What about asking environment or detect WSL2 directly during config_proxy?

For example:

[environment]  {Default is "Default"}
([D]efault, WSL[2]): 

@xiayh17
Copy link
Author

xiayh17 commented Aug 8, 2020

I found a way to judge the WSL version.
But after the WSL environment is detected, I need the user to diagnose whether the WSL version is 2.
Because I haven't found an infallible method to determine whether WSL is version 2.

For WSL2 users, this script has a hidden danger. LAN IP acquisition depends entirely on the resolv.conf file

❯ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.30.240.1

When resolv.conf be set as stop automatically generated. The script will not work.

@Ziy1-Tan
Copy link

This feature is what we need, are there any plans to restart it?

@xiayh17
Copy link
Author

xiayh17 commented Feb 6, 2023

This feature is what we need, are there any plans to restart it?

It appears that further modifications are necessary for the current version.

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.

None yet

3 participants