headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.48k stars 159 forks source link

proxy: unknown scheme: http #89

Open ghost opened 6 years ago

ghost commented 6 years ago

I setted up a proxy server in local PC with nginx. But when my configuration code as follow: err = bow.SetProxy("http://192.168.1.120:82") if err != nil { fmt.Println(err) } when I run my pro, then it show me as the title! Please help, thanks in advance!

ghost commented 6 years ago

image image

Joffcom commented 6 years ago

Have you tried setting the proxy using the SetTransport method like you would with the http client? Should act as a good work around for you.

ghost commented 6 years ago

@Joffcom I looked up source code , It contains the method setTransport, as follow: image

Joffcom commented 6 years ago

I would still give it a Bash but instead of dial use the Proxy option to see if it works.

You could try setting an HTTP_PROXY envvar to see if that sorts it as well

ghost commented 6 years ago

@Joffcom Yes, I've already tried, but it doesn't work. Meanwhile I need to implement IP switching dynamicly.

ghost commented 6 years ago

I've got an answer from myself .proxy address must be in this pattern: "http://192.168.1.120:82/"

Joffcom commented 6 years ago

Nice work so all it needed was the trailing the /