Coder Social home page Coder Social logo

bone-cli-proxy's Introduction

bone-cli-proxy

代理服务器 for bone

安装及使用

通过npm安装

$ npm install bone-cli-proxy 

安装后在bonefile.js文件内通过bone.cli()加载

var bone = require('bone');
var proxy = require('bone-cli-proxy');

bone.cli(proxy());

参数

port

type: number default: 8080

代理服务器的启用端口

enableReplace

type: boolean default: true

启用代理替换

replaceRules

type: array default: []

代理过程中替换文件规则,参数为二维数组,第一个值为正则,第二个值为被替换的文件

var proxy = require('bone-cli-proxy');
bone.cli(proxy{
	replaceRules: [
		[/www\.qq\.com\/([^.]*)/, '~/dist/qq/{$1}']
		[/www\.baidu\.com\/([^.]*)/, '~/dist/baidu/{$1}']
	]
});

enableLog

type: boolean default: false

启用http访问log

visitLog

type: stringstream default: '~/bone-cli-proxy/visit.log'

访问log写入目的地,可以传入一个可写流

enableResponseLog

type: boolean default: false

启用http返回log

responseLog

type: stringstream default: '~/bone-cli-proxy/response.log'

返回log写入目的地,可传入一个可写流

pac

type: stringboolean default: false

支持用pac方式的代理,可以填入一个网址或者true,参数为true时只匹配replaceRules内的规则

pacEncoding

type: string default: 'gbk'

pac文件编码

其他

命令行工具开发以及使用请参考处理器

站在巨人的肩膀上

bone-cli-proxy's People

Contributors

jansesun avatar wyicwx avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

jansesun

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.