How to make webmachine enjoyable with websockets?

Webmachine seems like a great system for building REST web services, but I know that it does not provide websocket compatibility. My question is pretty simple: What would be a good approach for adding websocket features on top of a web service created using webmachine?

+4
source share
3 answers

I am running Misultin along with Webmachine for this exact question.

+1
source

For convenient use of websockets in webmachine, I implemented this by modifying the sources of webmachine (adding support for mochiweb_websockets) and mochiweb (add secure support sites).

You can download the complete solution (webmachine with websockets support) from git at this link: https://github.com/Dryymoon/webmachine.git
And at this link an example of using the solution.

Or, if you want to dig a little deeper: I only changed two source files:
1) changed webmachine_decision_core.erl (add websocket support handler).
2) mochiweb_websocket.erl (add secure support web interfaces and existig patch).

0
source

The late answer, but just stumbled upon this, but another option is to run SimpleBridge ( https://github.com/nitrogen/simple_bridge ), which adds an abstraction layer (conditionally bypasses using the webmachines routing system), which adds websocket support to any erlang web server, which it supports (includes webmachine).

0
source

Source: https://habr.com/ru/post/1382955/


All Articles