Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery pubsub behaves differently using long-polling and websocket #187

Closed
maxqua72 opened this issue Feb 16, 2012 · 3 comments
Closed

jquery pubsub behaves differently using long-polling and websocket #187

maxqua72 opened this issue Feb 16, 2012 · 3 comments

Comments

@maxqua72
Copy link

I made a little change in JQueryPubSub.java adding @path("/{uid}/
{key}") as below

@post
@path("/{uid}/{key}")
@broadcast
public Broadcastable publish(@FormParam("message") String message,
@PathParam("uid") Integer uid, @PathParam("key") String key) {
return new Broadcastable(message, "", topic);
}

The client is the same for both websocket and long polling, the
client code is the same as the original pubsub with the slight add-on
in the location path:
/pubsub/pubsub/pippo/2/khkhgkh in order to simulate the uid and key.

The principle is that two clients can subscribe to the same topic but
only if they are identified users they can pubblish their messages, so
they have to add an userid and a passwordkey in order to push
something.
Using long-polling everything works ok but switching to websocket an error message occurs on the server:

DEBUG o.a.c.version.Jetty8WebSocket - 405 Method Not Allowed
WARN o.a.w.protocol.SimpleHttpProtocol - Status code higher than 400
Status 405 Message Method Not Allowed

The modified pubsub is on line @ http://www.mindthecheck.com/pubsub/
Other info in the thread:
http://groups.google.com/group/atmosphere-framework/browse_thread/thread/728d823bbeeba3a5#

@jfarcand
Copy link
Member

Salut, can you try the latest SNAPSHOT and let me know if you still see the issue?

@maxqua72
Copy link
Author

Hi,
Using 0.8.5 it was possible to specify the request url inside the push call but with 0.9 it is not possible if I understood well.
I tried anyway using
$.atmosphere.request = { url: document.location.toString() + 'pubsub/' + getElementById('topic').value+"/2/khkhgkh"};
just before the push but I cannot change the _request.url when the push is called and the 405 message is still there.
Tried with lon-polling and websocket, same result.

@jfarcand
Copy link
Member

OK closing this issue in favor of

   https://github.com/Atmosphere/atmosphere/issues/226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants