drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

adding example 'webserver reverse proxy' #2035

Open prothegee opened 1 month ago

prothegee commented 1 month ago

drogon framework example: webserver reverse proxy

NOTE:

this example show how to use drogon as webserver and using reverse proxy


steps:



preview result example



end of readme
an-tao commented 1 month ago

@prothegee Thanks so much for your patch. I noticed that there is currently a reverse proxy example in the example directory. Is your example different from it? Can you consider submitting your modifications based on the original example?

prothegee commented 1 month ago

drogon framework is more like http framework arsenal in my mind, dev user can leverage their existence knowledge to do what their want from drogon framework.

back when example of 'simple_reverse_proxy' exists, I had something in mind to use drogon framework as my core server rather than use nginx or h2o.

back then, I can't figure it out how extend this framework as webserver since it was early year I used drogon framework, so either I ended up using drogon as one backend in one machine using port 80 & 443 or I mix it up with another webserver.

and yet now I could figure it out how to extend as core server rather than use another webserver/server proxy.


my appoligies to not provide more information as the core purpose of my pr.


the keyword of 'simple example' and 'example' is already different.

to consider as modification from original example, offcourse I believe it's possible.. but the keyword 'simple_reverse_proxy' thou...


perhaps I could provide as 'reverse_proxy', 'webserver_reverse_proxy', or extend 'simple_reverse_proxy' then decide does this related pr is suitable to be merge or not, requesting permission from you/maintainer.


question: what does error mean on:

never use this kind of workflow, and how to fix those error by the way?

an-tao commented 1 month ago

@prothegee Thank you for your patient explanation, I will accept this PR after some code review

hwc0919 commented 1 month ago

I have a concern about creating large examples.

As drogon release new version, old examples may have compatiblility issues. It's hard to say that example authors will keep maintaining them. At last the maintaining work falls on us. I personally don't feel like to maintain something I don't use at all...

I suggest we create a standalone repo for large examples. At least it won't affect the main project.

rbugajewski commented 1 month ago

Sure, something like core and extras is a good idea.

prothegee commented 1 month ago

I had related closed issue with this, [HttpAppFramework / HttpClientPtr ] can't change/set (ssl key, cert, & configuration) after/on plugin

since currently drogon can't change/set included key, cert, & conf on the run, this example proly useless, unless using wildcard cert key

I think I'm gonna kept it on my branch fork repo or just let it dangle in that closed issue for historical search

Mis1eader-dev commented 4 weeks ago

I have swiftly sifted through it and I like the idea of the ReverseProxy plugin.

If we consider merging this, then I'll try to do a full review.

an-tao commented 4 weeks ago

Based on the above discussion, I think creating a new drogon-examples repo is a solution acceptable to everyone. I will do it ASAP.

albaropereyra22 commented 4 weeks ago

The Play framework has a repo for each example. That's one approach.

On Thu, May 30, 2024, 8:00 PM An Tao @.***> wrote:

Based on the above discussion, I think creating a new drogon-examples repo is a solution acceptable to everyone. I will do it ASAP.

— Reply to this email directly, view it on GitHub https://github.com/drogonframework/drogon/pull/2035#issuecomment-2141149836, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBZFRV52MWSNTYXAS5R4GR3ZE7RVVAVCNFSM6AAAAABIHG4D4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBRGE2DSOBTGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

hwc0919 commented 4 weeks ago

The Play framework has a repo for each example. That's one approach.

I vote for this

rbugajewski commented 3 weeks ago

I think one repo per example is too much, and will only increase burden on the maintainers, but if this organization would be bigger, I would also prefer this approach.