peterldowns / localias

custom local domain aliases for local dev servers
MIT License
605 stars 3 forks source link

Add basic Windows support #15

Closed hslatman closed 11 months ago

hslatman commented 1 year ago

This PR adds support for running localias on native Windows. The Windows hosts file is determined relative from the SystemRoot environment variable. Changes to the hosts file are written in a similar manner as the WSL implementation.

@peterldowns I'm curious if you would like this to (re)use the PowerShell scripts, for both installing the root cert, as well as writing the actual hosts file, so that it works similar to the WSL implementation. If so, I might move the scripts around a bit, so that they can be used by both packages.

Haven't tested all functionalities yet, but the basics seem to work. ~The admin socket may need some scrutiny, as using localias.exe run and then using ctrl-c to quit, leaves the socket in place.~ Probably just needs some cleanup at the end of the run loop (and/or force some cleanup if not already running, similar to how a new daemon is not started if it's already running).

peterldowns commented 11 months ago

Hey, thanks for the contribution. Unfortunately I use WSL2 instead of native Windows and I have no interest in maintaining native Windows support, so I'm going to close this. If more people start asking for this I may consider re-opening.