4 ms·
I do use nginx. This uses a "Simplish HTTP Push Relay Protocol". It's a way for your app (via curl or any other http library) to "connect" to your http clients.
by wizard_2 17y ago
I do use nginx. This uses a "Simplish HTTP Push Relay Protocol". It's a way for your app (via curl or any other http library) to "connect" to your http clients.
It has a few interesting options. "messages" are passed by a "channel id" and you can have any number of long polling listeners on a channel, or you can error out the first or last connections on a channel so there is only one listener at a time. If you have multiple listeners the message becomes a broadcast.
You also have a configurable amount of memory to buffer messages in the event there is no listener on a channel, or the listener is busy (receiving a message I guess). You can also set limits on number of messages per channel and a timeout.
I can see the advantages of this easily. The connections in nginx are much less resource intensive then a rails or php fast-cgi. You'll end up using much less ram. I know python has twisted and there are few others webservers for other languages, but this would allow me to run a php based chat server and take advantage of long polling.
I like it.