skilt
v0.2.0
Published
Web proxy server
Readme
Skilt
Web proxy server.
Lets you use your own domain names for apps in development running on localhost.
Install
This example will set up http://firmalisten.test to point to an app running on locahost port 5834.
First install the command line tool:
npm i -g skiltConfig
Add config file in ~/.config/skilt/sites.yml:
firmalisten:
host: firmalisten.test
port: 5843Add multiple domains like this:
firmalisten:
host: firmalisten.test www.firmalisten.test
port: 5843Wildcard domains work like this:
firmalisten:
host: *.firmalisten.test
port: 5843Add multiple apps like this:
firmalisten:
host: firmalisten.test
port: 5843
pay_eldoy_test:
host: pay.eldoy.test
port: 5988Local Setup
Add an entry for your domain in the /etc/hosts file to route firmalisten.test to localhost:
127.0.0.1 firmalisten.testWildcard domains
Instead of using the /etc/hosts file, use dnsmasq to forward browser requests to localhost:
brew install dnsmasqAdd this to $(brew --prefix)/etc/dnsmasq.conf:
address=/firmalisten.test/127.0.0.1Start dnsmasq as a service:
sudo brew services start dnsmasqAdd a file in /etc/resolver/firmalisten.test:
nameserver 127.0.0.1Test that it's working with:
ping sub.firmalisten.testArticle about this setup is found here.
Port
By default the skilt server runs on port 80. To change port start skilt using the SKILT_PORT env variable:
SKILT_PORT=8080 skilt startTo be able to use the HTTPS server, the local certificates has to be created and stored on the config/skilt dir first.
cd ~/.config/skilt
openssl req -x509 -newkey rsa:4096 -keyout localhost.key -out localhost.cert -days 365 -nodes -subj "/CN=localhost"Once the localhost.key and the localhost.cert files are created, the HTTPS server can be started like this:
skilt start --httpsor like this
skilt start -hCommands
Start your proxy server with:
skilt startStart quietly in background with:
nohup skilt start >/dev/null 2>&1TIP: This can be added as an alias to your .zshrc:
alias skiltq="nohup skilt start >/dev/null 2>&1"and then you run in background with skiltq &
Stop your proxy with:
skilt stopGo to http://firmalisten.test and enjoy!
MIT Licensed. Enjoy!
