websocketd icon indicating copy to clipboard operation
websocketd copied to clipboard

Rewriting mechanic

Open TuzelKO opened this issue 1 year ago • 1 comments

Hello! It would be useful to implement a rewrite mechanism, thanks to which different addresses could be passed to a single entry point, as does e.g. Nginx.

For example, I have several addresses: ws://ip:port/category1/action1, ws://ip:port/category1/action2, ws://ip:port/category2/action1... I would like all these connections to be poured into one script, and the path to be passed, for example, as a launch argument, so that the script’s internal router can decide what to do.

This function will allow you to easily integrate many PHP frameworks with WebSocketD.You can also make the setting with one argument at startup (--url-to-argv or --url-rewriting). The launched script will in turn receive this address as the first argument (php my-ws-script.php "/path/from/address")

TuzelKO avatar Jul 02 '24 06:07 TuzelKO

nothing nginx could potentially accomplish? Maybe? https://nginx.org/en/docs/http/websocket.html on websockets but combined with nginx capabilities...

mathieu-aubin avatar Aug 11 '24 20:08 mathieu-aubin