New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

hathor-proxy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hathor-proxy

Proxy plugin for Hathor, uses H2O2 under the hood.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Hathor Proxy

A wrapper around H2O2 for Hathor allowing simple proxy routes to be surface.

Route documentation can be found at https://github.com/hapijs/h2o2

Install:

npm install hathor-proxy

Example:

config/config.js

module.exports = {
  server: {
    plugins: [
      require('hathor-proxy')
    ],
    ...Typical stuff here...
  }
}

routes/httpbin/index.js

module.exports = {
  method: ['GET', 'POST', 'PUT', 'DELETE'],
  path: '/api/httpbin/{stuff*}',
  auth: true,
  config: {
    description: 'Basic proxy route to httpbin.',
    notes: 'Sends whatever it gets over to http://httpbin.org.',
    tags: ['api'],
  },
  handler: {
    proxy: {
      passThrough: true,
      mapUri(req, callback){
        return callback(null, `http://httpbin.org/${req.params.stuff}`)
      }
    }
  }
};

Start your app, hit /api/httpbin/get and see the glory!

FAQs

Package last updated on 17 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts