OpenSmpp / opensmpp

OpenSmpp - Java library implementing the SMPP protocol, and allowing development of External Short Message Entities (ESMEs) and more.
http://opensmpp.org/
Other
188 stars 170 forks source link

Need proxy support #38

Closed pdumais closed 6 years ago

pdumais commented 6 years ago

We need support for establishing an outbound connection through a proxy server. Is there already a mechanism in place to do this that I might have overlooked? If now, I'd be happy to submit a PR

paoloc0 commented 6 years ago

Hi. What specific sort of proxy server do you mean?

pdumais commented 6 years ago

I need to connect through a HTTP proxy server. But I found a way to do it:

InetSocketAddress address = new InetSocketAddress("proxy address", 8000);
Proxy proxy = new Proxy(Proxy.Type.HTTP, address);
socket = new Socket(proxy);
socket.connect(new InetSocketAddress(host, port));
TCPIPConnection connection = new TCPIPConnection(socket);

Although it would be nice to be able to just provide the proxy settings in the constructor maybe

paoloc0 commented 6 years ago

I see that this will use HTTP CONNECT proxying. You're lucky that your HTTP proxy server allows you to open connections to arbitrary outside ports - I hope that stays true for you.

I think maybe we should leave this as is. Yours is probably not such a common use case, and it's nice that one can pass in a Socket configured exactly how one wants (to use an HTTP proxy, a SOCKS proxy, etc.), without having to make every variation possible in the OpenSMPP code.

Perhaps the thing that's most missing is some FAQ-type documentation on this sort of thing, which we're admittedly very lean on. But at least we have an example here, now.

pdumais commented 6 years ago

Well actually, our proxy server doesn't allow me to access the smpp port. Step 1 was to see if your lib could use a proxy, now step 2 is to get IT to open the port.

Well at least this github issue contains the answer if anyone else needs to do the same.

Thanks.

pdumais commented 6 years ago

Well actually, our proxy server doesn't allow me to access the smpp port. Step 1 was to see if your lib could use a proxy, now step 2 is to get IT to open the port.

Well at least this github issue contains the answer if anyone else needs to do the same.

Thanks.