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

とにかく、私がまだ解決していないこの問題を知っている人はいますか

4

1 に答える 1

3

コールバックがローカルの場合、ハブは検証リクエストを送信する必要があるため、機能しません。Localhostコールバック URL の は、この URL が開発マシンに対してローカルであることを意味するため、ハブを含む Web の残りの部分からはアクセスできません :)

于 2012-01-06T13:44:30.410 に答える