Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run error #11

Closed
DamonGG opened this issue Oct 23, 2017 · 6 comments
Closed

run error #11

DamonGG opened this issue Oct 23, 2017 · 6 comments

Comments

@DamonGG
Copy link

DamonGG commented Oct 23, 2017

phantomjs 装了,环境看似没问题,就是起不起来,求教 -。-

➜  ProxyPool git:(master) ✗ ./ProxyPool
2017/10/23 12:55:07 Starting server :8080
2017/10/23 12:55:07 Chan: 0, IP: 35
2017/10/23 12:55:07 Before check, DB has: 35 records.
2017/10/23 12:55:07 IP66 done.
2017/10/23 12:55:07 Data5u done.
2017/10/23 12:55:07 IP181 done.
2017/10/23 12:55:08 PLP done.
panic: Post http://localhost:2015: dial tcp 127.0.0.1:2015: getsockopt: connection refused

goroutine 86 [running]:
panic(0x319340, 0xc4201afd40)
  /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/nladuo/go-phantomjs-fetcher.(*Fetcher).GetWithOption(0xc4200dc270, 0x37bed8, 0x23, 0x38393c, 0x6c, 0x371cac, 0xc, 0xc42057c880, 0x6f15f, 0xc420036e30, ...)
  /Users/xxx/Dev/go/src/github.com/nladuo/go-phantomjs-fetcher/fetcher.go:134 +0x436
github.com/nladuo/go-phantomjs-fetcher.(*Fetcher).GetWithJS(0xc4200dc270, 0x37bed8, 0x23, 0x38393c, 0x6c, 0x371cac, 0xc, 0x0, 0x0, 0x0)
  /Users/xxx/Dev/go/src/github.com/nladuo/go-phantomjs-fetcher/fetcher.go:97 +0x80
github.com/henson/ProxyPool/getter.XDL(0x0, 0x0, 0x0)
  /Users/xxx/Dev/go/src/github.com/henson/ProxyPool/getter/xdl.go:25 +0x1dc
main.run.func1(0xc42006e480, 0xc420158070, 0x3a5c50)
  /Users/xxx/code/test/ProxyPool/main.go:66 +0x2b
created by main.run
  /Users/xxx/code/test/ProxyPool/main.go:71 +0x14c
➜  ProxyPool git:(master) ✗ Error: Could not create web server listening on port 2016
Error: Could not create web server listening on port 2017



@henson
Copy link
Owner

henson commented Oct 23, 2017

panic: Post http://localhost:2015: dial tcp 127.0.0.1:2015: getsockopt: connection refused
Error: Could not create web server listening on port 2016
Error: Could not create web server listening on port 2017

是不是端口号冲突了,还是装了防火墙什么的限制了,phantomjs 未能正常运行

@DamonGG
Copy link
Author

DamonGG commented Oct 23, 2017

在main.go中将那几个有phantomjs的getter注释掉就没问题

55		// getter.KDL,
57		//getter.Xici,
58		//getter.XDL,

那么尝试换下端口呢:
vim getter/xdl.go

fetcher, err := phantomjs.NewFetcher(xxxxxx, nil)

go clean
go build
./ProxyPool 
依然不行:
Error: Could not create web server listening on port 2017
Error: Could not create web server listening on port 2015

重新编译,执行。端口并未更改,还是原来老样子。看了看 找不出哪里的bug

@henson
Copy link
Owner

henson commented Oct 23, 2017

getter.KDL,
getter.Xici,
getter.XDL,

对应2015~2017三个端口,你只改了2016

@DamonGG
Copy link
Author

DamonGG commented Oct 23, 2017

三个文件都改了,重新build, 端口依然是2015 2016 2017 没有任何变化

@henson
Copy link
Owner

henson commented Oct 23, 2017

不可能的,你再仔细检查检查

@DamonGG
Copy link
Author

DamonGG commented Oct 26, 2017

忘了回了。。
找到原因了,我是git clone安装的,然而在clone的目录下run跑的是
/env/go/src/github.com/henson/ProxyPool 目录下的代码

初识Go 慢慢学习中 anyway thanks your repos :)

@DamonGG DamonGG closed this as completed Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants