Code Monkey home page Code Monkey logo

proxrox's Introduction

proxrox   Join the chat at https://gitter.im/bripkens/proxrox Build Status Dependency Status devDependency Status npm version

Avoid SOP problems, combine origins, proxy services, use SSL, SPDY, SSI and more… during development!

Installation | Usage | Configuration | Example projects | Support | Changelog


Proxrox is a command line utility which starts a local Nginx instance to serve up static files, proxy one or many services under a single origin, use SSL locally and, generally, to get a development environment that is similar to a production environment.

Proxrox achieves this using Nginx. When proxrox is asked to start a server, it will create an Nginx config file in a temporary location and start an Nginx instance using this config file. This means that proxrox can theoretically support all of Nginx's features.

You can also use Proxrox to debug web apps, as shown in the following presentation.

Installation

TL;DR; npm install -g proxrox. Nginx needs to be on the $PATH and executable without super-user privileges.

Detailed installation instructions can be found in INSTALLATION.md.

Usage

Serve the current working directory via http:

proxrox start

Serve the current working directory via http and fall back to a proxy for all requests that couldn't be served from the working directory:

proxrox start --proxy http://127.0.0.1:8080

Enable server-side includes, transport layer security and SPDY support:

proxrox start --spdy --ssi

Start proxrox using a local configuration file. Format and supported options are explained in the CONFIGURATION.md file.

proxrox start .proxrox.yaml

Stop the running Nginx instances (stops all):

proxrox stop

Install Nginx. This command is platform specific and currently only works on OS X.

proxrox install

Experience has shown that the definition of options via configuration files, e.g. proxrox.yaml, is the most commonly used option. Working example projects with the recommended project setup can be seen in the examples directory.

Why proxrox exists

Production and development environment parity

Development environments should resemble production environments. This means that server-side includes, transport layer security, compression and more should exist during development. Not only is this important for page speed optimizations, but it also allows you to find security issues early, e.g. a secure page which references insecure content.

Serving multiple services under a single origin

Whether the app is service-oriented, micro service based, resource-oriented client architecture like or a single page app, the same-origin policy is often an issue for local development. People circumvent this issue in various ways. While most teams have good practices in place for production environments, development environments often lack this. Solutions I have seen range from cross-origin resource sharing for local development activated via feature flags to completely disabling web security in browsers.

Extending the space of possible solutions

Many people don't know or use server-side includes. There are probably various reasons for this. One thing that I noticed myself is that it just takes time to setup a proper development environment with proxy servers.

Support

Something not working as expected? Feel free to contact me on Twitter via @BenRipkens or use Gitter!

Usage Statistics

NPM NPM

License (MIT)

The MIT License (MIT)

Copyright (c) 2016 Ben Ripkens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

proxrox's People

Contributors

bripkens avatar basti1302 avatar orangecoding avatar

Watchers

James Cloos avatar  avatar

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.