anyproxy能在一个系统上启动多个任务吗?

zy1mlcev  于 2023-03-19  发布在  其他
关注(0)|答案(9)|浏览(180)

Plese fill the template when you reporting a new issue, thanks!

Which platform are you running AnyProxy

Mac

The version of the AnyProxy

老版本

Your expected behavior of AnyProxy
The actual behavior of AnyProxy
The log of the error
aelbi1ox

aelbi1ox1#

可以啊,指定端口就可以啊

xmakbtuz

xmakbtuz2#

@chenlei-123 通过在启动参数里面指定不同的端口即可启动多个任务

8wigbo56

8wigbo563#

@codingfishman
anyproxy --port 8001,然后另起终端,anyproxy --port 8080,就报错。
Caught exception: Error: listen EADDRINUSE :::8002
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (/usr/local/lib/node_modules/anyproxy/node_modules/_express@ 4.16.2@express /lib/application.js:618:24)
at /usr/local/lib/node_modules/anyproxy/lib/webInterface.js:145:26
at Object._plugIntoWebinterface (/usr/local/lib/node_modules/anyproxy/lib/rule_default.js:178:9)
at new webInterface (/usr/local/lib/node_modules/anyproxy/lib/webInterface.js:144:18)
at /usr/local/lib/node_modules/anyproxy/proxy.js:172:46

idv4meu8

idv4meu84#

@WonderfulLing
anyproxy --port 8001,然后另起终端,anyproxy --port 8080,就报错。
Caught exception: Error: listen EADDRINUSE :::8002
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (/usr/local/lib/node_modules/anyproxy/node_modules/_express@ 4.16.2@express /lib/application.js:618:24)
at /usr/local/lib/node_modules/anyproxy/lib/webInterface.js:145:26
at Object._plugIntoWebinterface (/usr/local/lib/node_modules/anyproxy/lib/rule_default.js:178:9)
at new webInterface (/usr/local/lib/node_modules/anyproxy/lib/webInterface.js:144:18)
at /usr/local/lib/node_modules/anyproxy/proxy.js:172:46

j2cgzkjk

j2cgzkjk5#

anyproxy -p XXX -w XXX
需要指定webport

jxct1oxe

jxct1oxe6#

@WonderfulLing
还是不行啊
anyproxy -p 8001 -w 8002,另起终端,anyproxy -p 9001 -w 9002,还是报错
Caught exception: Error: listen EADDRINUSE 0.0.0.0:8003
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at doListen (net.js:1501:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

goqiplq2

goqiplq27#

换到4.X的版本吧,wsport是随机的

htrmnn0y

htrmnn0y8#

@chenlei-123
使用4.0版后不需要再配置wsport,如果需要使用3.x,通过命令行启动会遇到端口冲突,你可以通过模块直接使用,指定port,webport和wsport即可,如下:

var proxy = require("anyproxy");

var options = {
    port          : 8001,
    rule          : require("path/to/my/ruleModule.js"), // rule文件
    webPort       : 8002,  // web ui 端口
    socketPort    : 8003,  // WebSocket端口
   interceptHttps: true, // 代理https
    silent        : false // 不打印日志
};
new proxy.proxyServer(options);

4.0相比3.x版本,rule接口上做了一些变更,如果你方便迁移的话,推荐使用4.0

zc0qhyus

zc0qhyus9#

anyproxy -p -w -e -i

相关问题