All Projects → ysbaddaden → Prax.cr

ysbaddaden / Prax.cr

Licence: other
Rack proxy server for development (Crystal port)

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to Prax.cr

Rack Tracker
Tracking made easy: Don’t fool around with adding tracking and analytics partials to your app and concentrate on the things that matter.
Stars: ✭ 601 (+323.24%)
Mutual labels:  rack
Letsencrypt heroku
Automated letsencrypt setup for heroku
Stars: ✭ 58 (-59.15%)
Mutual labels:  rack
As
VCV Rack Modules
Stars: ✭ 104 (-26.76%)
Mutual labels:  rack
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (+407.04%)
Mutual labels:  rack
Redis Rack
Redis session store for Rack
Stars: ✭ 46 (-67.61%)
Mutual labels:  rack
Nginx omniauth adapter
Use omniauth for nginx auth_request
Stars: ✭ 63 (-55.63%)
Mutual labels:  rack
Rack
A modular Ruby web server interface.
Stars: ✭ 4,260 (+2900%)
Mutual labels:  rack
Crepe
The thin API stack.
Stars: ✭ 120 (-15.49%)
Mutual labels:  rack
Rackula
Generate a static site from any rack middleware.
Stars: ✭ 49 (-65.49%)
Mutual labels:  rack
Cuba
Rum based microframework for web development.
Stars: ✭ 1,385 (+875.35%)
Mutual labels:  rack
Rack Throttle
Rack middleware for rate-limiting incoming HTTP requests.
Stars: ✭ 898 (+532.39%)
Mutual labels:  rack
Open api parser
A parser for Open API specifications
Stars: ✭ 30 (-78.87%)
Mutual labels:  rack
Rack Host Redirect
Rack middleware to redirect legacy domains
Stars: ✭ 64 (-54.93%)
Mutual labels:  rack
Agoo
A High Performance HTTP Server for Ruby
Stars: ✭ 679 (+378.17%)
Mutual labels:  rack
Rack Weixin
微信公众平台 开放消息接口 Rack Middleware
Stars: ✭ 105 (-26.06%)
Mutual labels:  rack
Rack Attack
Rack middleware for blocking & throttling
Stars: ✭ 5,012 (+3429.58%)
Mutual labels:  rack
Health bit
Tiny health check of Rack apps like Rails, Sinatra for use with uptime checking systems like Kubernetes, Docker or Uptimerobot
Stars: ✭ 60 (-57.75%)
Mutual labels:  rack
Vite ruby
⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
Stars: ✭ 112 (-21.13%)
Mutual labels:  rack
Capybara discoball
Spin up an external server just for Capybara
Stars: ✭ 116 (-18.31%)
Mutual labels:  rack
Ferrocarril
🚆 Experiments to embed Ruby on Rails in Rust with mruby
Stars: ✭ 66 (-53.52%)
Mutual labels:  rack

Prax

Rack proxy server for development

This is an (almost) complete rewrite of Prax in Crystal, a Ruby-inspired language that compiles down to LLVM. This version should avoid problems with version managers, since Prax is now a binary application that don't rely on Ruby anymore (except for Rack and rackup).

Please refer to the wiki for more information:

Install

You can download a Debian / Ubuntu package for 64bits kernel on the releases page. For other systems, you'll have to follow the Manual Install Guide.

How it works

  1. resolves *.test and *.localhost domains to 127.0.0.1 and ::1 (localhost);
  2. redirects the :80 and :443 ports to :20559 and :20558;
  3. receives incoming HTTP requests and extracts the hostname (eg: myapp.test);
  4. serves static files directly if they exist;
  5. otherwise spawns a Rack applications (found at ~/.prax/myapp) if any;
  6. and proxies the request to the Rack aplication or a specified port for port forwarding.

Domain Resolver

systemd

If your distribution uses systemd-resolved, just use the .localhost TLD instead of .test —be prepared to fight against systemd if you want to use another TLD, or consider switching to a systemd free Linux.

.test TLD

Prax proposes 2 solutions to resolve .test and .localhost domains:

  • a dnsmasq configuration, either throught NetworkManager or by installing dnsmasq manually (eg. through your Linux distribution package);
  • an obsolete and deprecated NSSwitch extension, only compatible wih glibc and no longer compatible with Google Chrome/Chromium, and certainly more.

xip.io

Prax supports http://xip.io/ domains, so you can use myapp.129.168.0.1.xip.io for example. This is useful when using an external device like a smartphone, tablet or another computer to test your websites on.

Custom TLD

If .test or .localhost domains are not your cup of tea, no problem! Prax will route requests from any TLD to the applications in your ~/.prax directory, as long as the domain resolves to localhost.

For instance, if you wished to visit myapp.dev instead of myapp.test, you could create dnsmasq configuration to resolve .dev domains to localhost, too:

$ sudo tee /etc/dnsmasq.d/dev <<EOF
local=/dev/
address=/dev/127.0.0.1
address=/dev/::1
EOF
$ sudo service dnsmasq restart

Port Redirections

The port redirections are iptables rules, that are installed and removed using an initd script. The script redirects the port :80 and :443 on 127.0.0.1 and for each wlanX and ethX devices found on your machine, to allow incoming traffic, so you can use http://xip.io to test on external devices, as mentioned above.

You can install or remove the redirections with:

$ prax iptables [start|stop|restart|status]

Distribution packages should configure an init service to always install the iptables rules on machine startup or before starting prax (warning: this requires root privileges).

License

Prax is distributed under the CeCILL 2.1 license. Please see LICENSE for details.

HTML templates for rendering errors are from Pow!!, by Sam Stephenson and Basecamp, and are under the MIT license.

The NSSwitch extension originaly come from Hoof, by pyromaniac, and is under the MIT license.

Credits

Prax wouldn't exist without Pow!! by Sam Stephenson and Basecamp. Prax is nothing more but a reimplementation (in another language) with Linux compatibility in mind.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].