http://pubsubhubbub.appspot.com/subscribe 407 需要身份验证

发布于 2024-12-25 00:54:55 字数 1929 浏览 5 评论 0原文

我有一个连接到 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();

有没有人知道这个问题 反正我还没解决 谢谢

I have a subscriber client that connects to https://pubsubhubbub.appspot.com/subscribe I put parameter below

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

i define proxy settings also,doesnot shown below
but i take 407 authentication required response

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();

is there anyone know this problem
i havent solved yet anyway
thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云雾 2025-01-01 00:54:55

如果您的回调是本地的,它将永远不会工作,因为集线器需要向其发送验证请求。回调 URL 中的 Localhost 意味着该 URL 是您的开发计算机的本地 URL,因此无法从网络的其余部分(包括集线器)访问:)

If your callback is local, it will never work, as the hub needs to send it a verification request. Localhost in your callback url means that this url is local to your development machine, hence not accessible from the rest of the web, including the hub :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文