Giter VIP home page Giter VIP logo

skilt's Introduction

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 skilt

Config

Add config file in ~/.config/skilt/sites.yml:

firmalisten:
  host: firmalisten.test
  port: 5843

Add multiple domains like this:

firmalisten:
  host: firmalisten.test www.firmalisten.test
  port: 5843

Wildcard domains work like this:

firmalisten:
  host: *.firmalisten.test
  port: 5843

Add multiple apps like this:

firmalisten:
  host: firmalisten.test
  port: 5843
pay_eldoy_test:
  host: pay.eldoy.test
  port: 5988

Local Setup

Add an entry for your domain in the /etc/hosts file to route firmalisten.test to localhost:

127.0.0.1 firmalisten.test

Wildcard domains

Instead of using the /etc/hosts file, use dnsmasq to forward browser requests to localhost:

brew install dnsmasq

Add this to $(brew --prefix)/etc/dnsmasq.conf:

address=/firmalisten.test/127.0.0.1

Start dnsmasq as a service:

sudo brew services start dnsmasq

Add a file in /etc/resolver/firmalisten.test:

nameserver 127.0.0.1

Test that it's working with:

ping sub.firmalisten.test

Article 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 start

Commands

Start your proxy server with:

skilt start

Start quietly in background with:

nohup skilt start >/dev/null 2>&1

TIP: 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 stop

Go to http://firmalisten.test and enjoy!

MIT Licensed. Enjoy!

skilt's People

Contributors

eldoy avatar

Watchers

 avatar

skilt's Issues

skilt config

Add new skilt config command that opens the config in you favorite editor.

skilt auto-reload

Automatically restart when you change the config, or even if you change the hosts file.

Sometimes needs restart

Seems random, but sometimes you need to restart skilt to avoid request hanging. Needs investigation.

Load external config

Would be cool to load an external config file on startup so you can share between computers. Keep the skilt config file in a public git repo for example...

Various errors and warnings

Route for localhost not found.
Route for localhost not found.
Route for localhost not found.
/Users/vidar/.nvm/versions/node/v16.15.1/lib/node_modules/skilt/node_modules/rekvest/index.js:13
  req.href = decodeURI(req.href)
             ^

URIError: URI malformed
    at decodeURI (<anonymous>)
    at module.exports (/Users/vidar/.nvm/versions/node/v16.15.1/lib/node_modules/skilt/node_modules/rekvest/index.js:13:14)
    at getRoute (/Users/vidar/.nvm/versions/node/v16.15.1/lib/node_modules/skilt/index.js:55:3)
    at Server.<anonymous> (/Users/vidar/.nvm/versions/node/v16.15.1/lib/node_modules/skilt/index.js:67:17)
    at Server.emit (node:events:527:28)
    at parserOnIncoming (node:_http_server:956:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.