tink_http icon indicating copy to clipboard operation
tink_http copied to clipboard

[Feature] Support for requests through HTTP proxy

Open zicklag opened this issue 7 years ago • 4 comments

I am behind an HTTP proxy that requires authentication and I need to make HTTP/HTTPS requests through the proxy in order to get to the Internet. It would be perfect if we could implement this functionality in Tink.

In particular, I would hope to be able to use it for the Lix project. I have an open issue about it here: lix-pm/lix.client#29

zicklag avatar Mar 03 '18 00:03 zicklag

I think we could do something like this

class ProxyClient implements ClientObject {
  var client:Client;
  var settings:ProxySettings;

  public function new(client, settings) {
    this.client = client;
    this.settings = settings;
  }

  public function request(req) {
    var header = ...; // modify the header according to the proxy settings
    return client.request(new OutgoingRequest(header, req.body));
  }
}

kevinresol avatar Mar 20 '18 15:03 kevinresol

I like it! :wink: I don't have a whole lot of time to work on it, but if I get the chance I'll try it. Thanks.

zicklag avatar Mar 29 '18 00:03 zicklag

Any updates?

kevinresol avatar Mar 06 '19 15:03 kevinresol

I never really got to work on it unfortunately. Got busy. :confused: And the project I'm working with right now is Kha and Armory3D and they use git submodules for everything, so it hasn't been as necessary for me.

zicklag avatar Mar 06 '19 16:03 zicklag