{"id":23524164,"url":"https://github.com/kimtth/xmpp-socketio-rabbitmq","last_synced_at":"2026-04-07T22:32:17.988Z","repository":{"id":103356842,"uuid":"292737316","full_name":"kimtth/xmpp-socketio-rabbitmq","owner":"kimtth","description":"🤺 Study for messaging protocols. XMPP with xmpp.js, Websocket with Socket.io, AMQP with RabbitMQ in Docker.","archived":false,"fork":false,"pushed_at":"2020-09-29T04:19:12.000Z","size":1073,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T06:26:49.873Z","etag":null,"topics":["amqp","bitnami","docker","ejabberd","hooks","koa","messaging","nodejs","rabbitmq-client","reactjs","socket-io","websocket","xmpp-client"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kimtth.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-09-04T03:15:40.000Z","updated_at":"2021-06-08T11:46:13.000Z","dependencies_parsed_at":"2023-07-07T19:15:18.693Z","dependency_job_id":null,"html_url":"https://github.com/kimtth/xmpp-socketio-rabbitmq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kimtth/xmpp-socketio-rabbitmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fxmpp-socketio-rabbitmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fxmpp-socketio-rabbitmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fxmpp-socketio-rabbitmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fxmpp-socketio-rabbitmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimtth","download_url":"https://codeload.github.com/kimtth/xmpp-socketio-rabbitmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimtth%2Fxmpp-socketio-rabbitmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31532291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","bitnami","docker","ejabberd","hooks","koa","messaging","nodejs","rabbitmq-client","reactjs","socket-io","websocket","xmpp-client"],"created_at":"2024-12-25T18:14:46.168Z","updated_at":"2026-04-07T22:32:17.979Z","avatar_url":"https://github.com/kimtth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attempts for finding a proper solution.\n\n# XMPP Server\n\nejabberd (Most Popular XMPP server)\n\n- User: admin@- localhost or admin@domain-name\n\n- Password: e.g. admin (User defined)\n\n- Management UI: http://localhost:5280/admin/\n\n- Configuration file:  C:\\ProgramData\\ejabberd\\conf\\ejabberd.yml\n\n```bash\n    port: 5443\n    module: ejabberd_http\n    tls: false\n    request_handlers:\n      \"/admin\": ejabberd_web_admin\n      \"/api\": mod_http_api\n      \"/bosh\": mod_bosh\n      \"/captcha\": ejabberd_captcha\n      \"/upload\": mod_http_upload\n      \"/ws\": ejabberd_http_ws\n      \"/oauth\": ejabberd_oauth\n  -\n```\n\n- Endpoint (Turn-Off the TLS): \n\n    ws://localhost:5443/ws (WebSocket)\n\n    http://localhost:5443/bosh (from Browser)\n\n    if you are success, you will reach the below page from browser. \n\n```bash\nejabberd ejabberd_http_ws\nAn implementation of WebSocket protocol\n\nThis web page is only informative. To use WebSocket connection you need a Jabber/XMPP client that supports it.\n```\n\n- Creating Testing Account on Management UI\n\n    ID: guest@domain-name Password: guest\n\n    ID: guest2@domain-name Password: guest\n    \n- Conclusion of XMPP client using StanzaJS / simple-xmpp / xmpp.js\n\n\u003e These APIs support a wrapper for common events such as connect, disconnect, send. \nbut for handling message-queue and route, broadcast, it needs to develop a custom layer for communicating with ejabberd API. \n \n\n 1. stanzaJS: Not sufficient explanation on API documents and few implementation and example. \n  it has to look into deep inside of code. https://github.com/legastero/stanza\n \n 2. simple-xmpp: Wrapper of node-simple-xmpp. It uses deprecated API inside of the core module, \n  not able to make a connection with ejabberd server. https://github.com/simple-xmpp/node-simple-xmpp.git\n\n 3. xmpp.js: xmpp.js is required to develop group-chat and broadcast by referring to the protocol document. https://github.com/xmppjs/xmpp.js.git\n \n\n  It would need to define custom event and listener in the middleware which calls the ejabberd api for processing multi-user chat and user-related data.\n  \n  for example, ejabberd \u003c---\u003e middleware (custom event handler \u0026 ejabber api caller) \u003c---\u003e client \n  \n  middleware. e.g. ejabberd-bridge: python. https://github.com/dirkmoors/pyejabberd.git\n  \n  ```python\n  # Broadcasting\n    def broadcast(msg):\n        for user in users:\n            xmpp.send(user, msg) # Something similar function is required for emitting the message to the client.\n  ```\n\n# RabbitMQ with Docker\n\n## Docker\n\n```\n$ docker --version\n$ docker pull rabbitmq:3-management\n$ docker run -d -p 15672:15672 -p 5672:5672 --name rabbit-dev rabbitmq:3-management\n```\n\nor\n\nAfter Switching Windows containers (Docker \u003e Settings)\n\n```\n$ docker pull bitnami/rabbitmq:latest\n$ docker run -d -p 15672:15672 -p 5672:5672 --name rabbit-dev bitnami/rabbitmq:latest\n```\n\n## RabbitMQ\nhttp://localhost:15672/#/\n\nThe default login is 'guest guest'. If you are using bitnami, default is 'UserName:user/Password:bitnami'.\n\n - HostName: “localhost”\n - UserName: “guest”\n - Password: “guest”\n - Port: 5672\n\n https://medium.com/dev-genius/rabbitmq-with-docker-on-windows-in-30-minutes-172e88bb0808\n \n## Install Docker on Windows Server \n\nNot able to find a proper solution using Linux containers in Windows server. Instead of docker, with installing it directly on Windows server is a better solution.\n\n```powershell\n$ Install-WindowsFeature containers\n$ Install-Module -Name DockerMsftProvider -Repository PSGallery -Force\n$ Install-Package -Name docker -ProviderName DockerMsftProvider -Force \n$ Start-Service docker  \n$ Restart-Computer -Force\n```\n\n```powershell\n## To switch to Linux Containers\n\n$ [Environment]::SetEnvironmentVariable(\"LCOW_SUPPORTED\", \"1\", \"Machine\")\n\n# Enable Experimental Features in Dockerd daemon.conf\n$configfile = @\"\n{\n    \"experimental\": true\n}\n\"@\n$configfile | Out-File -FilePath C:\\ProgramData\\docker\\config\\daemon.json -Encoding ascii -Force\n$ Restart-Service docker\n\n# https://github.com/linuxkit/lcow/releases\n\n$ Invoke-WebRequest -Uri \"https://github.com/linuxkit/lcow/releases/download/v4.14.35-v0.3.9/release.zip\" -UseBasicParsing -OutFile release.zip\n$ Expand-Archive release.zip -DestinationPath \"$Env:ProgramFiles\\Linux Containers\n$ docker run --rm -it --platform=linux ubuntu bash\n\n## To switch back to Windows Containers\n\n$ [Environment]::SetEnvironmentVariable(\"LCOW_SUPPORTED\", $null, \"Machine\")\n$ Restart-Service docker\n```\n\n# Socket.io specification\n\nhttps://stackoverflow.com/questions/32674391/io-emit-vs-socket-emit/32675498\n\n```javascript\nsocket.emit('message', \"this is a test\"); //sending to sender-client only\nsocket.broadcast.emit('message', \"this is a test\"); //sending to all clients except sender\nsocket.broadcast.to('game').emit('message', 'nice game'); //sending to all clients in 'game' room(channel) except sender\nsocket.to('game').emit('message', 'enjoy the game'); //sending to sender client, only if they are in 'game' room(channel)\nsocket.broadcast.to(socketid).emit('message', 'for your eyes only'); //sending to individual socketid\nio.emit('message', \"this is a test\"); //sending to all clients, include sender\nio.in('game').emit('message', 'cool game'); //sending to all clients in 'game' room(channel), include sender\nio.of('myNamespace').emit('message', 'gg'); //sending to all clients in namespace 'myNamespace', include sender\nsocket.emit(); //send to all connected clients\nsocket.broadcast.emit(); //send to all connected clients except the one that sent the message\nsocket.on(); //event listener, can be called on client to execute on server\nio.sockets.socket(); //for emiting to specific clients\nio.sockets.emit(); //send to all connected clients (same as socket.emit)\nio.sockets.on() ; //initial connection from a client.\n\nsocket.emit will send back message to sender only,\nio.emit will send message to all the client including sender\nif you want to send message to all but not back to sender then socket.broadcast.emit\n```\n\n# The Commands for execution\n\n- The Client\n\n```\n$ yarn start\n```\n\n- The Server\n\n```\n$ yarn nodemon server\n```\n\n- Deployment\n\n```\n$ yarn build\n$ node server\n```\n\nDefault Port is 8080. http://localhost:8080\n\n![ref](./doc/socket_demo.gif?raw=true)\n\n# References\n\nPros and Cons\n\n- MQTT: IOT | Lightweight | Security vulnerabilities | IBM\n- AMQP: JP Morgan | Binary | Erlang | Application Layer | RabbitMQ (Route/Queue/Publish-Subscribe/Topic) | Battery consuming issue on Mobile device | Application-wide notification\n- XMPP: A Communication protocol for messaging | Application Layer | Security | XML based | Decentralization | Goolge Talk\n- WebSocket: Full-duplex communication | Application Layer | Underlying TCP | Browser | Centralization\n\nMQTT uses a more stream-orientated approach, making it easy for low-memory clients to write frames. AMQP uses a buffer-orientated approach, making possible high-performance servers.\n\nhttps://stackoverflow.com/questions/23158842/using-rabbitmq-in-android-for-chat\n\nhttps://stackoverflow.com/questions/6636213/rabbitmq-vs-socket-io\n\nhttps://medium.com/@thinkwik/web-sockets-vs-xmpp-which-is-better-for-chat-application-113e3520b327\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimtth%2Fxmpp-socketio-rabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimtth%2Fxmpp-socketio-rabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimtth%2Fxmpp-socketio-rabbitmq/lists"}