# Slim 4 Websocket integration

**URL:** <https://discourse.slimframework.com/t/slim-4-websocket-integration/3952>\
**Category:** Show and Tell\
**Created:** [March 20, 2020, 3:53pm UTC](https://discourse.slimframework.com/t/slim-4-websocket-integration/3952 "2020-03-20T15:53:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tj\_gumis](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@tj\_gumis](https://discourse.slimframework.com/u/tj_gumis)\
**Post date:** [March 20, 2020, 3:53pm UTC](https://discourse.slimframework.com/t/slim-4-websocket-integration/3952/1 "2020-03-20T15:53:24Z")

</div>

Recently I’ve chalenged myself with this issue:  
[Slim 3 framework and Twig with Ajax GET and POST for Home Page Chat problem?](https://discourse.slimframework.com/t/slim-3-framework-and-twig-with-ajax-get-and-post-for-home-page-chat-problem/3926)

I was hoping, if I dig deep enough it would be possible to find some nice and simple integration solution for [ratchet](http://socketo.me/) with Slim 4.  
Yes it can be done, but I did not succeed, because the result I achieved, was neither nice nor simple considering engaged resources and amount of code necessary to add to an application just a simple chat functionality. In my humble opinion php is still not ready for a client - server bidirectional interaction.

I did not want to relay totally on nodejs, so I started searching for some hybrid solutions, meaning the simplest possible, just to make websocket integration smooth and simple for an ordinary developer. I found [elephant.io](https://github.com/Wisembly/elephant.io) and I think I succeed this time.

Please take a look at the result and maybe give some feedback:

### [slim-4-websocket](https://bitbucket.org/paneric/slim-4-websocket)
