Git Product home page Git Product logo

hp's Introduction

hp

HTTP Proxy Kit.

Features

  • Web debugging proxy

proxy

  • Live browser reloads, instantly see changes in your browser

live

  • Remote logging for mobile development

remote

Install

$ npm install hp -g

Usage

Usage: hp [options]

Options:
  --config, -c  proxy config file                               [default: "Proxyfile.js"]
  --target, -t  target directory                                [default: "."]
  --port, -p    server port                                     [default: 3000]
  --log         log requests mode                               [default: "default"]
  --live, -l    enable live reload changed files                [default: false]
  --watch, -w   files be watched when live reload enabled       [default: "**/*.*"]
  --console     enable remote logging service                   [default: false]
  --proxies     enable request proxy
  --open, -o    open the default browser after server starting  [default: false]

Options

// Proxyfile.js
module.exports = {
    // `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'
    // `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms'
    //` tiny`  ':method :url :status :res[content-length] - :response-time ms'
    // `dev` concise output colored by response status for development use
    log: 'default',
    port: 8080,
    console: true,
    proxies: [
        {
            location: "/cgi-bin/",
            host: "127.0.0.1"
        },
        {
            location: "/cgi-bin2/",
            host: "127.0.0.1",
            rewrite: {
                '/cgi-bin2/test': '/rest/test1',
                '/cgi-bin2/test2': '/rest/test2'
            }
        },
        {
            location: "/js/",
            // root specifies the document root for the requests
            // For example, the request "/js/test.js" will return the file "./dist/js/test.js".
            root: "./dist"
        },
        {
            location: "/images/",
            // alias specifies a path to be used as the basis for serving requests for the indicated location
            // For example, the request "/images/test.png" will return the file "./img/test.png".
            alias: "./img"
        },
        {
            location: "/index2.html",
            file: "./index.html"
        }
    ]
}

hp's People

Contributors

yuanyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hp's Issues

Neat!

Just wanted to say this is cool. Good job!

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.