drogonframework / drogonframework/drogon
Expose more ways to obtain information about requests
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Is your feature request related to a problem? Please describe.**
In a reverse proxy application it is essential to know information about a request like its protocol (http, ws, etc.), or whether the request itself is a WebSocket.
Otherwise `drogon::app().forward(...)` can't make proper forwarding to the backend without rewriting what is already implemented in [HttpServer.cc](https://github.com/drogonframework/drogon/blob/96919df488e0ebaa0ed304bbd76bba33508df3cc/lib/src/HttpServer.cc#L1021).
**Describe the solution you'd like**
Several options:
1. Expose the protocol string.
2. Add a local boolean member within requests called `isWebSocket`.
3. Expose the already implemented method in [HttpServer.cc](https://github.com/drogonframework/drogon/blob/96919df488e0ebaa0ed304bbd76bba33508df3cc/lib/src/HttpServer.cc#L1021).
**Describe alternatives you've considered**
Rewriting the current implementation.
Contributor guide
Assessment
This issue has not been assessed yet.