drogonframework / drogonframework/drogon

Expose more ways to obtain information about requests

Open
#2,005 0 comments 2 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.