JavaPNS 2.2 を使用して、プロキシ経由で Apple デバイスにプッシュしようとしています。私の Java アプリケーションはファイアウォールの背後にある jBoss で実行されており、Apple サーバーと通信する唯一の方法はそのプロキシを経由することです。
public ApplePushNotification(File certificate){
super();
ProxyManager.setProxy("myproxy", "myport");
this.certificate = certificate;
}
この例外が発生しています。
javapns.communication.exceptions.CommunicationException: Communication exception: java.io.IOException: Unable to tunnel through. Proxy returns "HTTP/1.1 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )"
そこで、ProxyManager.java ファイルを読んで、承認の方法を見つけました。私はこれを見つけました:
/**
* Configure the authorization for the proxy configured through the setProxy method.
*
* @param username the user name to use
* @param password the password to use
*/
public static void setProxyBasicAuthorization(String username, String password) {
setProxyAuthorization(encodeProxyAuthorization(username, password));
}
その静的メソッドを使用しようとしましたがProxyManager.setProxy("myproxy", "myport");
、使用できません。助けていただければ幸いです。ありがとう
追加のリンク:
http://code.google.com/p/javapns/source/browse/trunk/src/javapns/communication/ProxyManager.java