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.
精彩评论