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

Persistent HTTP connections #513

Open
grover opened this issue Feb 3, 2016 · 2 comments
Open

Persistent HTTP connections #513

grover opened this issue Feb 3, 2016 · 2 comments
Labels

Comments

@grover
Copy link

grover commented Feb 3, 2016

The non-blocking HTTP handler (#425) introduced in 0.6.0 simplifies the implementation of HTTP handlers for most use cases. One part that websocketpp is missing though is support for HTTP/1.1 persistent connections, which enable a client to send multiple requests over the same socket. This is especially useful with TLS enabled as the TLS handshakes and TCP connection times can lead to a less-than ideal experience in the real world.

@zaphoyd
Copy link
Owner

zaphoyd commented Feb 4, 2016

The basic idea here is that instead of closing the TCP connection after an HTTP request when content-length bytes have been read, leave it open for some period of time and if any new bytes are read, treat them as additional HTTP requests?

@zaphoyd zaphoyd added the Feature label Feb 4, 2016
@grover
Copy link
Author

grover commented Feb 4, 2016

Yeah, the basic idea is to not close the socket after handling a single HTTP request, but go back into the read to wait for the next request. I have version that does that and seems to work, but is vulnerable to a slowloris type of attack. I will create a pull request with this soon and hope to get some input as to enhancements or changes I could make.

Regarding the slowloris, I'm currently thinking of enhancing this to prevent those types of attacks.

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

No branches or pull requests

2 participants