4

Webmachine seems like a great system to build REST web services, but I know it does not provide websocket compatibility. My question is rather straightforward : What would be a good approach to add websocket capabilities on top of a web service built with webmachine?

matehat
  • 5,214
  • 2
  • 29
  • 40

3 Answers3

1

I'm running Misultin alongside Webmachine for that exact matter.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • Thanks a lot for the suggestion, it looks great! For the records, the project on google code is discontinued, but development continues on [github](https://github.com/ostinelli/misultin). – matehat Nov 25 '11 at 22:47
  • 3
    Also the latest commits can handle the most recent versions of websockets. – rvirding Nov 26 '11 at 00:54
0

For easy use websockets in webmachine I implemented that by changing sources of webmachine (adding support mochiweb_websockets ) and mochiweb (add support secure websockets).

You can download from git full solution (webmachine with websockets support) by this link: https://github.com/Dryymoon/webmachine.git
And by this link example usage of solution.

Or if want dig a little deeper: I changed only two files of sources:
1) webmachine_decision_core.erl changed (add support websocket handler).
2) mochiweb_websocket.erl (add support secure websockets and patch existig).

dryymoon
  • 131
  • 1
  • 4
0

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 bypassed using webmachines routing system) which adds websocket support to any erlang webserver it supports (includes webmachine).

chops
  • 2,572
  • 1
  • 16
  • 25