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

Socks proxy support #79

Closed
artemklevtsov opened this issue Jun 8, 2018 · 8 comments
Closed

Socks proxy support #79

artemklevtsov opened this issue Jun 8, 2018 · 8 comments
Milestone

Comments

@artemklevtsov
Copy link

Hi,

It would be nice to add a socks proxy support to use with TOR for example.

@artemklevtsov
Copy link
Author

Now as workaround opts can be used.

@sckott
Copy link
Collaborator

sckott commented Jun 8, 2018

thanks @artemklevtsov

will have a look. can you show me how you do it with curl options? and what kind of "support" are you looking for?

@artemklevtsov
Copy link
Author

I tried redirect all requests through local TOR daemon (socks://localhost:9050). Seems your proxy helper now support only http proxy. I passed correct proxy url with opts arg when initialize HttpClient.

@sckott
Copy link
Collaborator

sckott commented Jun 11, 2018

is there a way I can locally test or send through a public tor or so?

@sckott
Copy link
Collaborator

sckott commented Jun 11, 2018

note to self - in python https://stackoverflow.com/a/33875657/1091766

@artemklevtsov
Copy link
Author

artemklevtsov commented Jun 13, 2018

Thank you for the quick reply.

You should start tor-daemon before.

Now works:

cl2 <- crul::HttpClient$new(
    url = "http://ifconfig.co",
    opts = list(proxy = "socks5://localhost:9050")
)
cl2$get("ip")$parse("utf8")

But don't work:

cl3 <- crul::HttpClient$new(
    url = "http://ifconfig.co",
    proxies = crul::proxy(url = "socks5://localhost:9050")
)
cl3$get("ip")$parse("utf8")

@sckott sckott added this to the v0.6 milestone Jun 13, 2018
@sckott
Copy link
Collaborator

sckott commented Jun 13, 2018

thanks. do you ever use auth (e.g.,, simple auth, user:pwd) with tor?

@sckott
Copy link
Collaborator

sckott commented Jun 13, 2018

can you try again after reinstalling. this should work:

crul::HttpClient$new(
    url = "http://ifconfig.co",
    proxies = proxy(url = "socks5://localhost:9050", auth = NULL)
)

have to set auth = NULL for now. if people use auth, i need to sort out how thats done, but if people don't have auth to a tor proxy then we can do proxy(url = "socks5://localhost:9050") and internally remove the auth bits

@sckott sckott closed this as completed Jul 8, 2018
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