JSPM

  • Created
  • Published
  • Downloads 202
  • Score
    100M100P100Q94873F
  • License MIT

hiproxy is a Node.js proxy client

Package Exports

  • hiproxy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hiproxy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hiproxy

A Node.js proxy client

Build Status Coverage Status npm Node.js version license

安装

npm install -g hiproxy

使用

  1. 启动服务
cd your_workspace
hiproxy start -p 5525 --debug
  1. 设置代理
127.0.0.1:5525

API

ProxyServer

Kind: global class

new ProxyServer(httpPort, httpsPort)

hiproxy代理服务器

Param Type Description
httpPort Number http代理服务端口号
httpsPort Number https代理服务器端口号

proxyServer.start(httpPort, httpsPort) ⇒ Promise

启动代理服务

Kind: instance method of ProxyServer
Access: public

Param Type Description
httpPort Number http服务端口号
httpsPort Number https服务端口号

proxyServer.stop() ⇒ ProxyServer

停止代理服务

Kind: instance method of ProxyServer
Access: public

proxyServer.restart() ⇒ ProxyServer

重启代理服务

Kind: instance method of ProxyServer
Access: public

proxyServer.addHostsFile(filePath) ⇒ ProxyServer

添加Hosts文件

Kind: instance method of ProxyServer
Access: public

Param Type Description
filePath String | Array hosts文件路径(绝对路径)

proxyServer.addRewriteFile(filePath) ⇒ ProxyServer

添加rewrite文件

Kind: instance method of ProxyServer
Access: public

Param Type Description
filePath String | Array rewrite文件路径(绝对路径)

proxyServer.openBrowser(browserName, url, [usePacProxy]) ⇒ ProxyServer

打开浏览器窗口

Kind: instance method of ProxyServer
Access: public

Param Type Default Description
browserName String 浏览器名称
url String 要打开的url
[usePacProxy] Boolean false 是否使用自动代理

proxyServer.findConfigFiels([dir]) ⇒ ProxyServer

在指定工作空间(目录)下查找配置文件 hiproxy会在指定的空间下所有一级目录下查找配置文件

Kind: instance method of ProxyServer
Access: public

Param Type Default Description
[dir] String process.cwd() 工作空间(目录)