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

doio-proxy

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doio-proxy

fast proxy for doio and titbit

latest
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

doio-proxy

基于doio框架的快速代理,基于消息头的host实现,同时支持多路径匹配转发,不同路径可以对应不同的后台服务。

安装

npm i doio-proxy

使用

'use strict';

const doio = require('doio');
const doioproxy = require('doio-proxy');

let hostcfg = {

    //会自动转换为数组的形式,默认path为 / 
    'a.com' : 'http://localhost:8001',

    //会自动转换为数组的形式
    'b.com' : {
        path : '/xyz',
        url : 'http://localhost:8002'
    },

    //标准形式
    'c.com' : [
        {
            path : '/name',
            url  : 'http://localhost:8003'
        },

        {
            path : '/',
            url : 'http://localhost:8004'
        }
    ]

};

const app = new doio();

const proxy = new doioproxy({
    host : hostcfg
});

proxy.init(app);

//输出路由表
app.printRoute();

//监听2000端口,启用2个worker子进程处理请求
app.daemon(2000, 2);

Keywords

proxy

FAQs

Package last updated on 08 Oct 2020

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