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

Jcabi-http proxy tunneling support #136

Open
super132 opened this issue May 27, 2016 · 8 comments
Open

Jcabi-http proxy tunneling support #136

super132 opened this issue May 27, 2016 · 8 comments

Comments

@super132
Copy link

It would be great if jcabi-http supports HTTP proxy settings / tunneling. Right now in environments that traffic requires proxy access, jcabi-http fails to do so as it does not accept any proxy information to establish the connection. This limits the usage of this library.

@dmarkov
Copy link

dmarkov commented May 30, 2016

@yegor256 please pay attention to this issue (par.21)

@yegor256 yegor256 added the bug label Jun 27, 2016
@yegor256
Copy link
Member

@dmarkov pls assign @westonized

@dmarkov
Copy link

dmarkov commented Jun 28, 2016

@dmarkov pls assign @westonized

@yegor256 yep, done. @westonized it is your task now

@dmarkov
Copy link

dmarkov commented Jun 28, 2016

@super132 thanks for reporting! I topped your account for 15 mins, transaction AP-6RL05986X3753332C

@westonal
Copy link
Contributor

westonal commented Jul 1, 2016

@yegor256 This is so wide open, as PO can you provide an example of the desired syntax?

i.e. adjust this to take proxy settings, and does it also require to take authentication?

String html = new JdkRequest("https://www.google.com/test")
      .uri().path("/users").queryParam("id", 333).back()
      .method(Request.GET)
      .header(HttpHeaders.ACCEPT, MediaType.TEXT_HTML)
      .fetch()
      .as(RestResponse.class)
      .assertStatus(HttpURLConnection.HTTP_OK)
      .body();

@yegor256
Copy link
Member

yegor256 commented Jul 7, 2016

@westonized I think it should be done like this:

String html = new JdkRequest("https://www.google.com/test")
      .uri().path("/users").queryParam("id", 333).back()
      .method(Request.GET)
      .header(HttpHeaders.ACCEPT, MediaType.TEXT_HTML)
      .through(ProxyWire.class, "192.168.1.1", "8080", "login", "password") // this one!
      .fetch()
      .as(RestResponse.class)
      .assertStatus(HttpURLConnection.HTTP_OK)
      .body();

@krzyk
Copy link

krzyk commented Aug 9, 2016

@westonized any updates on the solution?

@amihaiemil
Copy link
Member

amihaiemil commented May 25, 2017

Until this ticket is resolved, if you're using JdkRequest, you can set the proxy on the JVM and it will work. You can easily set it, for example in eclipse:

image

If you're using JavaEE you may have to set it on the server's (Jboss, Glassfish etc) JDK as well, unless it uses the jdk provided by the IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@krzyk @yegor256 @dmarkov @westonal @amihaiemil @super132 @andreoss and others