开发者

java-apns with http proxy problem

my project used java-apns to send notification to iPhone. before that, i have to go through a http proxy. so i add proxy feature like this:

Proxyproxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost,
                Integer.parseInt(proxyPort)));
ApnsServiceBuilder apnBuilder = APNS.newService().withCert(certPath, passwd).withProxy(proxy);

but i always get invalid proxy error:

java.lang.IllegalArgumentException: Invalid Proxy
at java.net.Socket.<init>(Socket.java:122)
at com.notnoop.apns.ApnsServiceBuilder.withProxy(ApnsServiceBuilder.java:281)
开发者_如何学编程

is there anybody could give me some advices? Thanks very much.


Sadly this is a bug in (Oracle) Java - only DIRECT and SOCKS proxy is supported for Socket. See http://bugs.sun.com/view_bug.do?bug_id=6370908.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜