JavaPNS 2.2를 사용하여 프록시를 통해 사과 장치로 푸시하려고합니다. 내 자바 응용 프로그램은 방화벽 뒤의 jBoss에서 실행 중이며 사과 서브와 통신하는 유일한 방법은 그 물마루 프록시입니다.JavaPNS 2.2에서 프록시 사용
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
http://code.google.com/p/javapns/
내가 그 setProxyBasicAuthorization (문자열 이름, 문자열 암호)를 발견 정적 방법은 javapns 2.3_Beta에 포함되어 있습니다. 나는 베타를 시도 할 것이다. – user1841944