Add support for Websockets (RFC 6455)
As a developer of a reactive, rich client-application, I would like to use websocket connections to the webserver, so that I can easily push content from the server to the clients.
Example
Very vague - clarity comes with implementation.
class IWebsocketHandler
{
void Initialize(Connection connection);
void HandleFrame(Frame frame);
}
var socket = Websocket.Create<MyHandler>();
Acceptance criteria
- The
Websockethandler is a regularIHandlerthat can be added where required - There is a separate
GenHTTP.Modules.Websocketmodule, with a minimal hook into the server core to gain control over the socket
This would be quite helpful to have
Websockets, along with form-based authentication, are the next topics on the agenda.
Due to my parental leave in summer, there will be few changes from my side in the next months. Pull requests or preparatory changes are of course always welcome.
Would it also be possible to render a page without any theming? Basically increment some data then view page
On Wed, May 4, 2022, 3:30 AM Andreas Nägeli @.***> wrote:
Websockets, along with form-based authentication, are the next topics on the agenda.
Due to my parental leave in summer, there will be few changes from my side in the next months. Pull requests or preparatory changes are of course always welcome.
— Reply to this email directly, view it on GitHub https://github.com/Kaliumhexacyanoferrat/GenHTTP/issues/82#issuecomment-1117007708, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALTBPP7KTHBSJ755RAWXKVTVIIRSLANCNFSM4QTZJ52Q . You are receiving this because you commented.Message ID: @.***>
If you would like to use the Website module, you will need a theme - an empty theme should not be much effort. If you do not need the features provided by the Website, you can just render a Page in the default server theme:
var page = Page.From("My Content") // or ModScriban.Page() or ModRazor.Page() or Placeholders.Page()
.Title("My Title")
.Description("My description");
var layout = Layout.Create()
.Add("page", page); // http://localhost:8080/page
Host.Create()
.Handler(layout)
.Defaults()
.Development()
.Console()
.Run();
Razor and Scriban allow you to render a model into a template (e.g. read from the file system).
Or, if you are fine with plain text, even easier:
var handler = Inline.Create()
.Get("/page", () => "Hello World!");
Host.Create()
.Handler(handler)
.Run();
How about the websocket module, is it ready for use?