/wslipconf

Auto Configure Port Forwarding From WSL

Primary LanguageC#Apache License 2.0Apache-2.0

WSLIPConf

Auto Configure Port Forwarding From WSL for Windows Desktop

v1.2.0 Available

December 26, 2022

  • Support for IPv6
  • Support for multiple distributions
  • Cleaner, slightly more prettied interface

Summary

This program automatically detects the WSL IP address using the Linux ip command, and sets up netsh portproxies for the IPv4/IPv6 address/port combinations using native interop.

This is useful for running test projects in VS Code under WSL that serve and listen. This will allow you to use your Windows-based browser or other front-end projects while running the back-end project in WSL.

Version 1.2 adds support for all proxy bindings:

  • IPv4 to IPv4
  • IPv4 to IPv6
  • IPv6 to IPv4
  • IPv6 to IPv6

Just download the code, compile it, and start the project. It should be relatively self-explanatory.

Alternatively: Binaries for x64 can be found in the binaries folder.

The program needs elevated (administrator) privileges to run correctly.

You might need to run 'git submodule init' and 'git submodule update' from the root of the project folder to grab the MessageBoxEx project.

If for any reason the window gets messed up and you can't fix it, go into the registry under HKEY_CURRENT_USER\Software\Nathaniel Moschkin\WSLIPConf and delete the window geometry key.

Screens

Main Screen

(The accent color is detected from your Windows 8/10/11 color scheme)

Here you can do several things, including refreshing the table from the current netsh system configuration. You can also check a box that will cause this application to start automatically when Windows starts.

The application will minimize to the system tray and will start minimized on system startup.

Left click the icon to see the current IP address in a toast. Right-click the tray icon for menu options.

Binding Configuration

You can also set up port forwarding with addresses other than WSL. Just uncheck the 'Automatic WSL Destination' checkbox.