http://pubsubhubbub.appspot.com/subscribe 407 authenticationrequired

时间:2012-01-06 13:25:58

标签: java subscription pubsubhubbub

我有一个订阅者客户端连接到https://pubsubhubbub.appspot.com/subscribe我把参数放在

下面
https://pubsubhubbub.appspot.com/subscribe
hub.topic    http://...../lastupby
hub.callback http://localhost:8080/Subscription/subscription/subscribe
hub.mode subscribe

我也定义代理设置,如下所示 但我需要407认证所需的响应

HttpPost httppost = new HttpPost(hub);  
                    List<NameValuePair> nvps = new ArrayList<NameValuePair>();
                    nvps.add(new BasicNameValuePair("hub.callback", callbackUrl));
                    nvps.add(new BasicNameValuePair("hub.mode", "subscribe"));
                    nvps.add(new BasicNameValuePair("hub.topic", topic_url));
                    nvps.add(new BasicNameValuePair("hub.verify", "sync"));
                    if (lease_seconds != null)
                        nvps.add(new BasicNameValuePair("hub.lease_seconds", lease_seconds));
                    //For future https implementation
                    //if ((secret !=null) && (secret.getBytes("utf8").length < 200))
                    //  nvps.add(new BasicNameValuePair("hub.hub.secret", secret));
                    if (verifytoken !=null)
                        nvps.add(new BasicNameValuePair("hub.verify_token", verifytoken));

                    webserver.addAction("subscribe",topic_url, verifytoken);

                    httppost.setEntity(new UrlEncodedFormEntity(nvps));
                    httppost.setHeader("Content-type", "application/x-www-form-urlencoded");
                    httppost.setHeader("User-agent", "RSS pubsubhubbub 0.3");

                    //create the thread and start it running
                    GetThread thread = new GetThread(httpClient, httppost);
                    thread.start();
                    thread.join();

有没有人知道这个问题 无论如何我还没有解决 谢谢

1 个答案:

答案 0 :(得分:2)

如果您的回调是本地的,它将无法运行,因为集线器需要向其发送验证请求。回调网址中的Localhost表示此网址是您的开发计算机的本地网址,因此无法从网络的其余部分访问,包括集线器:)