alibaba / anyproxy

A fully configurable http/https proxy in NodeJS
http://anyproxy.io
Apache License 2.0
7.86k stars 1.22k forks source link

Linux CentOS 6.3安装不成功 #260

Closed frankie0802 closed 6 years ago

frankie0802 commented 7 years ago

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

Which platform are you running AnyProxy

Linux CentOS 6.3

The version of the AnyProxy

anyproxy@3.10.4

Your expected behavior of AnyProxy

安装anyproxy成功

The actual behavior of AnyProxy

安装anyproxy失败,bash: anyproxy: command not found

The log of the error

sudo npm install -g anyproxy

/home/cloud-disk1/private/pengfei06/node-v6.11.3-linux-x64/bin/anyproxy -> /home/cloud-disk1/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/bin.js /home/cloud-disk1/private/pengfei06/node-v6.11.3-linux-x64/lib └─┬ anyproxy@3.10.4 ├── async@0.9.2 ├── async-task-mgr@1.1.0 ├─┬ body-parser@1.18.2 │ ├── bytes@3.0.0 │ ├── content-type@1.0.4 │ ├─┬ debug@2.6.9 │ │ └── ms@2.0.0 │ ├── depd@1.1.1 │ ├─┬ http-errors@1.6.2 │ │ ├── inherits@2.0.3 │ │ └── setprototypeof@1.0.3 │ ├─┬ on-finished@2.3.0 │ │ └── ee-first@1.1.1 │ ├── qs@6.5.1 │ ├─┬ raw-body@2.3.2 │ │ └── unpipe@1.0.0 │ └─┬ type-is@1.6.15 │ ├── media-typer@0.3.0 │ └── mime-types@2.1.17 ├─┬ change-case@3.0.1 │ ├── camel-case@3.0.0 │ ├── constant-case@2.0.0 │ ├── dot-case@2.1.1 │ ├── header-case@1.0.1 │ ├── is-lower-case@1.1.3 │ ├── is-upper-case@1.1.2 │ ├── lower-case@1.1.4 │ ├── lower-case-first@1.0.2 │ ├── no-case@2.3.2 │ ├── param-case@2.1.1 │ ├── pascal-case@2.0.1 │ ├── path-case@2.1.1 │ ├── sentence-case@2.1.1 │ ├── snake-case@2.1.0 │ ├── swap-case@1.1.2 │ ├── title-case@2.1.1 │ ├── upper-case@1.1.3 │ └── upper-case-first@1.1.2 ├── colorful@2.1.0 ├── commander@2.3.0 ├─┬ compression@1.7.1 │ ├─┬ accepts@1.3.4 │ │ ├── mime-types@2.1.17 │ │ └── negotiator@0.6.1 │ ├─┬ compressible@2.0.11 │ │ └── mime-db@1.30.0 │ ├── on-headers@1.0.1 │ ├── safe-buffer@5.1.1 │ └── vary@1.1.2 ├─┬ express@4.16.1 │ ├── array-flatten@1.1.1 │ ├── content-disposition@0.5.2 │ ├── cookie@0.3.1 │ ├── cookie-signature@1.0.6 │ ├── encodeurl@1.0.1 │ ├── escape-html@1.0.3 │ ├── etag@1.8.1 │ ├── finalhandler@1.1.0 │ ├── fresh@0.5.2 │ ├── merge-descriptors@1.0.1 │ ├── methods@1.1.2 │ ├── parseurl@1.3.2 │ ├── path-to-regexp@0.1.7 │ ├─┬ proxy-addr@2.0.2 │ │ ├── forwarded@0.1.2 │ │ └── ipaddr.js@1.5.2 │ ├── range-parser@1.2.0 │ ├─┬ send@0.16.1 │ │ ├── destroy@1.0.4 │ │ └── mime@1.4.1 │ ├── serve-static@1.13.1 │ ├── setprototypeof@1.1.0 │ ├── statuses@1.3.1 │ └── utils-merge@1.0.1 ├── iconv-lite@0.4.19 ├── ip@0.3.3 ├─┬ juicer@0.6.15 │ ├─┬ optimist@0.3.7 │ │ └── wordwrap@0.0.3 │ └── uglify-js@1.2.6 ├─┬ mime-types@2.1.11 │ └── mime-db@1.23.0 ├─┬ nedb@0.11.2 │ ├── async@0.2.10 │ ├── binary-search-tree@0.2.4 │ ├── mkdirp@0.3.5 │ └── underscore@1.4.4 ├─┬ node-easy-cert@1.1.3 │ └── commander@2.11.0 ├── node-forge@0.6.49 ├─┬ npm@2.15.12 │ ├── abbrev@1.0.9 │ ├── ansi@0.3.1 │ ├── ansi-regex@2.0.0 │ ├── ansicolors@0.3.2 │ ├── ansistyles@0.1.3 │ ├── archy@1.0.0 │ ├── async-some@1.0.2 │ ├── block-stream@0.0.9 │ ├── char-spinner@1.0.1 │ ├── chmodr@1.0.2 │ ├── chownr@1.0.1 │ ├── cmd-shim@2.0.2 │ ├─┬ columnify@1.5.4 │ │ └─┬ wcwidth@1.0.0 │ │ └─┬ defaults@1.0.3 │ │ └── clone@1.0.2 │ ├─┬ config-chain@1.1.10 │ │ └── proto-list@1.2.4 │ ├─┬ dezalgo@1.0.3 │ │ └── asap@2.0.3 │ ├── editor@1.0.0 │ ├── fs-vacuum@1.2.9 │ ├─┬ fs-write-stream-atomic@1.0.8 │ │ └── iferr@0.1.5 │ ├── fstream@1.0.10 │ ├─┬ fstream-npm@1.1.1 │ │ └── fstream-ignore@1.0.5 │ ├── github-url-from-git@1.4.0 │ ├── github-url-from-username-repo@1.0.2 │ ├─┬ glob@7.0.6 │ │ ├── fs.realpath@1.0.0 │ │ └── path-is-absolute@1.0.0 │ ├── graceful-fs@4.1.6 │ ├── hosted-git-info@2.1.5 │ ├── imurmurhash@0.1.4 │ ├── inflight@1.0.5 │ ├── inherits@2.0.3 │ ├── ini@1.3.4 │ ├─┬ init-package-json@1.9.4 │ │ ├─┬ glob@6.0.4 │ │ │ └── path-is-absolute@1.0.0 │ │ └── promzard@0.3.0 │ ├── lockfile@1.0.1 │ ├─┬ lru-cache@4.0.1 │ │ ├── pseudomap@1.0.2 │ │ └── yallist@2.0.0 │ ├─┬ minimatch@3.0.3 │ │ └─┬ brace-expansion@1.1.6 │ │ ├── balanced-match@0.4.2 │ │ └── concat-map@0.0.1 │ ├─┬ mkdirp@0.5.1 │ │ └── minimist@0.0.8 │ ├─┬ node-gyp@3.6.0 │ │ └── semver@5.3.0 │ ├── nopt@3.0.6 │ ├── normalize-git-url@3.0.2 │ ├─┬ normalize-package-data@2.3.5 │ │ └─┬ is-builtin-module@1.0.0 │ │ └── builtin-modules@1.1.0 │ ├── npm-cache-filename@1.0.2 │ ├── npm-install-checks@1.0.7 │ ├── npm-package-arg@4.1.0 │ ├─┬ npm-registry-client@7.2.1 │ │ ├─┬ concat-stream@1.5.2 │ │ │ ├─┬ readable-stream@2.0.6 │ │ │ │ ├── core-util-is@1.0.2 │ │ │ │ ├── isarray@1.0.0 │ │ │ │ ├── process-nextick-args@1.0.7 │ │ │ │ ├── string_decoder@0.10.31 │ │ │ │ └── util-deprecate@1.0.2 │ │ │ └── typedarray@0.0.6 │ │ └── retry@0.10.0 │ ├── npm-user-validate@0.1.5 │ ├─┬ npmlog@2.0.4 │ │ ├─┬ are-we-there-yet@1.1.2 │ │ │ └── delegates@1.0.0 │ │ └─┬ gauge@1.2.7 │ │ ├── has-unicode@2.0.0 │ │ ├─┬ lodash.pad@4.4.0 │ │ │ ├── lodash._baseslice@4.0.0 │ │ │ ├── lodash._basetostring@4.12.0 │ │ │ └── lodash.tostring@4.1.4 │ │ ├── lodash.padend@4.5.0 │ │ └── lodash.padstart@4.5.0 │ ├── once@1.4.0 │ ├── opener@1.4.1 │ ├─┬ osenv@0.1.3 │ │ ├── os-homedir@1.0.0 │ │ └── os-tmpdir@1.0.1 │ ├── path-is-inside@1.0.1 │ ├─┬ read@1.0.7 │ │ └── mute-stream@0.0.5 │ ├─┬ read-installed@4.0.3 │ │ ├── debuglog@1.0.1 │ │ ├── readdir-scoped-modules@1.0.2 │ │ └── util-extend@1.0.1 │ ├─┬ read-package-json@2.0.4 │ │ ├─┬ glob@6.0.4 │ │ │ └── path-is-absolute@1.0.0 │ │ └─┬ json-parse-helpfulerror@1.0.3 │ │ └── jju@1.3.0 │ ├─┬ readable-stream@2.1.5 │ │ ├── buffer-shims@1.0.0 │ │ ├── core-util-is@1.0.2 │ │ ├── isarray@1.0.0 │ │ ├── process-nextick-args@1.0.7 │ │ ├── string_decoder@0.10.31 │ │ └── util-deprecate@1.0.2 │ ├── realize-package-specifier@3.0.1 │ ├─┬ request@2.74.0 │ │ ├── aws-sign2@0.6.0 │ │ ├── aws4@1.4.1 │ │ ├─┬ bl@1.1.2 │ │ │ └─┬ readable-stream@2.0.6 │ │ │ ├── core-util-is@1.0.2 │ │ │ ├── isarray@1.0.0 │ │ │ ├── process-nextick-args@1.0.7 │ │ │ ├── string_decoder@0.10.31 │ │ │ └── util-deprecate@1.0.2 │ │ ├── caseless@0.11.0 │ │ ├─┬ combined-stream@1.0.5 │ │ │ └── delayed-stream@1.0.0 │ │ ├── extend@3.0.0 │ │ ├── forever-agent@0.6.1 │ │ ├─┬ form-data@1.0.0-rc4 │ │ │ └── async@1.5.2 │ │ ├─┬ har-validator@2.0.6 │ │ │ ├─┬ chalk@1.1.3 │ │ │ │ ├── ansi-styles@2.2.1 │ │ │ │ ├── escape-string-regexp@1.0.5 │ │ │ │ ├── has-ansi@2.0.0 │ │ │ │ └── supports-color@2.0.0 │ │ │ ├─┬ commander@2.9.0 │ │ │ │ └── graceful-readlink@1.0.1 │ │ │ ├─┬ is-my-json-valid@2.13.1 │ │ │ │ ├── generate-function@2.0.0 │ │ │ │ ├─┬ generate-object-property@1.2.0 │ │ │ │ │ └── is-property@1.0.2 │ │ │ │ ├── jsonpointer@2.0.0 │ │ │ │ └── xtend@4.0.1 │ │ │ └─┬ pinkie-promise@2.0.1 │ │ │ └── pinkie@2.0.4 │ │ ├─┬ hawk@3.1.3 │ │ │ ├── boom@2.10.1 │ │ │ ├── cryptiles@2.0.5 │ │ │ ├── hoek@2.16.3 │ │ │ └── sntp@1.0.9 │ │ ├─┬ http-signature@1.1.1 │ │ │ ├── assert-plus@0.2.0 │ │ │ ├─┬ jsprim@1.3.0 │ │ │ │ ├── extsprintf@1.0.2 │ │ │ │ ├── json-schema@0.2.2 │ │ │ │ └── verror@1.3.6 │ │ │ └─┬ sshpk@1.9.2 │ │ │ ├── asn1@0.2.3 │ │ │ ├── assert-plus@1.0.0 │ │ │ ├── dashdash@1.14.0 │ │ │ ├── ecc-jsbn@0.1.1 │ │ │ ├── getpass@0.1.6 │ │ │ ├── jodid25519@1.0.2 │ │ │ ├── jsbn@0.1.0 │ │ │ └── tweetnacl@0.13.3 │ │ ├── is-typedarray@1.0.0 │ │ ├── isstream@0.1.2 │ │ ├── json-stringify-safe@5.0.1 │ │ ├─┬ mime-types@2.1.11 │ │ │ └── mime-db@1.23.0 │ │ ├── node-uuid@1.4.7 │ │ ├── oauth-sign@0.8.2 │ │ ├── qs@6.2.1 │ │ ├── stringstream@0.0.5 │ │ ├── tough-cookie@2.3.1 │ │ └── tunnel-agent@0.4.3 │ ├── retry@0.10.0 │ ├── rimraf@2.5.4 │ ├── semver@5.1.0 │ ├─┬ sha@2.0.1 │ │ └─┬ readable-stream@2.0.2 │ │ ├── core-util-is@1.0.1 │ │ ├── isarray@0.0.1 │ │ ├── process-nextick-args@1.0.3 │ │ ├── string_decoder@0.10.31 │ │ └── util-deprecate@1.0.1 │ ├── slide@1.1.6 │ ├── sorted-object@2.0.0 │ ├── spdx-license-ids@1.2.2 │ ├── strip-ansi@3.0.1 │ ├── tar@2.2.1 │ ├── text-table@0.2.0 │ ├── uid-number@0.0.6 │ ├── umask@1.1.0 │ ├─┬ validate-npm-package-license@3.0.1 │ │ ├── spdx-correct@1.0.2 │ │ └─┬ spdx-expression-parse@1.0.2 │ │ └── spdx-exceptions@1.0.4 │ ├─┬ validate-npm-package-name@2.2.2 │ │ └── builtins@0.0.7 │ ├─┬ which@1.2.11 │ │ └── isexe@1.1.2 │ ├── wrappy@1.0.2 │ └── write-file-atomic@1.1.4 ├─┬ promise@7.3.1 │ └── asap@2.0.6 ├── qrcode-npm@0.0.3 ├─┬ stream-throttle@0.1.3 │ └── limiter@1.1.2 └─┬ ws@1.1.4 ├── options@0.0.6 └── ultron@1.0.2

codingfishman commented 7 years ago

@frankie0802 请试试安装node-legacy,然后再安装AnyProxy,看是否可以:

sudo apg-get install nodejs-legacy
frankie0802 commented 7 years ago

// 系统是centOS,所以用的yum安装。但是报没有可用的nodejs-legacy包。。。 sudo yum install nodejs-legacy Loaded plugins: aliases, downloadonly, fastestmirror, priorities, security Determining fastest mirrors centos6.3 | 951 B 00:00
centos6.3/primary | 2.0 MB 00:00
centos6.3 6356/6356 epel | 4.2 kB 00:00
epel/primary_db | 5.7 MB 00:00
Setting up Install Process No package nodejs-legacy available. Error: Nothing to do

frankie0802 commented 7 years ago

@codingfishman thanks

frankie0802 commented 7 years ago

更新了yum源为阿里的镜像源: http://blog.csdn.net/a491857321/article/details/53453165

还是找不到nodejs-legacy: sudo yum install nodejs-legacy Loaded plugins: aliases, downloadonly, fastestmirror, priorities, security Loading mirror speeds from cached hostfile

frankie0802 commented 7 years ago

安装成功了: the default rule for AnyProxy. Root CA does not exist, will not intercept any https requests. Anyproxy rules initialize finished, have fun! GUI interface started at : http://10.94.168.105:8002/ Http proxy started at 10.94.168.105:8001 是软连接的问题,手动添加下就行了

但第二次启动anyproxy就报错,看日志是websocket端口占用未被杀掉? [root@cp01-hao123-11 bin]# anyproxy the default rule for AnyProxy. Root CA does not exist, will not intercept any https requests. Anyproxy rules initialize finished, have fun! GUI interface started at : http://10.94.168.105:8002/ Http proxy started at 10.94.168.105:8001 Caught exception: Error: listen EADDRINUSE 0.0.0.0:8001 at Object.exports._errnoException (util.js:1020:11) at exports._exceptionWithHostPort (util.js:1043:20) at Server._listen2 (net.js:1258:14) at listen (net.js:1294:10) at Server.listen (net.js:1390:5) at async.series.self.ws.wsServer.port (/home/work/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/proxy.js:150:38) at /home/work/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/node_modules/async/lib/async.js:607:21 at /home/work/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/node_modules/async/lib/async.js:246:17 at iterate (/home/work/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/node_modules/async/lib/async.js:146:13) at /home/work/private/pengfei06/node-v6.11.3-linux-x64/lib/node_modules/anyproxy/node_modules/async/lib/async.js:157:25 AnyProxy is about to exit with code: 0

frankie0802 commented 7 years ago

每次启动anyproxy前将node端口杀死就行了: pkill -9 node

codingfishman commented 7 years ago

也就是说AnyProxy,在命令行关闭后,不会主动关闭端口是吗?

frankie0802 commented 6 years ago

@codingfishman 对的,必须手动杀

codingfishman commented 6 years ago

@frankie0802 谢谢