-
Notifications
You must be signed in to change notification settings - Fork 122
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
Allowing redirects for hubs #22
Comments
Very good point! |
After thinking about this problem I'm not sure that redirects would work well. First, we would have to use redirects for POST with HTTP 307 (that's the only status code that can redirect a POST request), which isn't a very common thing to do. Here's what http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html has to say:
This means the hub users (subscribers and publishers) MUST NOT follow 307 redirect automatically. Another reason I don't feel comfortable with redirects in the protocol is increased complexity. The protocol is intentionally very easy for subscribers and publishers to implement. If we allow hubs to return redirects, publishers and subscribers will have to learn how to handle them. |
I agree with both of your theoretical points @romkatv. But I also think reality show(s)(ed) that some hubs will go away, even when some publishers are still pointing to them. So that leaves us with 2 evils:
Accpting that subscription break may be a good way of 'policing' things as subscribers will probably get in touch with publishers telling them to switch hubs. |
The problem of hubs disappearing is a real one. In general we can't expect the dead hubs to stay forever and do the redirects, so redirects in the protocol won't solve the problem completely. A disappearing hub that wants to be nice should do the following:
That's the same protocol as I would expect from any decent service. I forgot to mention another disadvantage of using redirects on a hub: publishers will have to repeat their full requests, including the payload, after seeing the redirect. That's wasteful. |
Subscriptions should have to be renewed on a regular basis and clients should check to see that they have the current hub upon renewal. |
Hub moves are like api endpoint moves. They should be handled with provider <-> developer communication and a (very) long deprecation time. This does not belong in the protocol itself but it is something each PuSH provider should handle on their own, given their resources and limitations. |
Hubs should be able to redirect subscribers and publishers to another hub:
It's likely that hubs will die (some of died already) and if things are really decentralized in the way that the hub does not know about the publishers pointing to it (it's likely and happens a lot), then, we need a way for the hub to tell subscribers it moved.
The text was updated successfully, but these errors were encountered: