Closed kinow closed 9 years ago
Thanks!
I didn't want to expose the Type object in Snacktory API,
Why? Isn't it a regular Java class?
Or is it necessary to create a new proxy per request? I.e. is a proxy object Proxy threadsafe?
If the Proxy is thread-safe then why not using it directly instead of string+port? This would make it cleaner IMO and faster I guess
That would work as well, and I'm fine with both designs. Let me know if you want me to submit another pull request, or feel free to adjust the code to use the Proxy object.
I think the Proxy object should be just a POJO with the server information (though I never investigated it), the only reason why I didn't expose it was because I wasn't sure if you'd be all right with that or not :-)
BTW, I had a look at the Travis CI failure, but I'm not sure if the PR caused the error.
Let me know if you want me to submit another pull request,
You can just push to your branch and this will change here. I would prefer using the Proxy object only. But this can be done only if it is really threadsafe - do you know about it?
I wasn't sure if you'd be all right with that or not :-)
I'm okay with that, sure :)
BTW, I had a look at the Travis CI failure, but I'm not sure if the PR caused the error.
Yeah, I think that this failed before (some integration tests)
Let me know if you want me to submit another pull request,
You can just push to your branch and this will change here. I would prefer using the Proxy object only. But this can be done only if it is really threadsafe - do you know about it?
Done!
Looks so, from the Javadocs: "(...) A Proxy is an immutable object". So I believe we are good to use it in the code :-)
Nice, thanks!
BTW: would you have some time to replace or correct the current failing integration tests :)? I'm currently involved in other projects and not using this anymore in production so it might be wise to hand over a bit of responsibility :)
Hi @karussell,
Here's a first tentative to add proxies to Snacktory (thanks for writing it by the way). I didn't want to expose the Type object in Snacktory API, so users have to provide the proxy type as text (they can use the Type enum to get the type name).
Some simple JUNit tests attached. Tried to keep the code style (no tabs), but feel free to further massage the code if needed, as I didn't spend much time looking at the rest of the code to standardize the code.
Successfully tested with Snacktory against a CNTLM HTTP proxy and a SSH SOCKS proxy. Both seemed to work, but as your comment in the code suggested, quite slow.
Hope that helps, Bruno