{"id":19973275,"url":"https://github.com/zeromq/jsmq","last_synced_at":"2025-07-16T12:35:28.706Z","repository":{"id":17967750,"uuid":"20962807","full_name":"zeromq/JSMQ","owner":"zeromq","description":"Javascript client for ZeroMQ/NetMQ","archived":false,"fork":false,"pushed_at":"2019-12-09T12:36:17.000Z","size":24,"stargazers_count":194,"open_issues_count":6,"forks_count":45,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-08T01:37:53.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeromq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-18T13:23:41.000Z","updated_at":"2025-03-24T07:40:35.000Z","dependencies_parsed_at":"2022-09-14T22:00:25.446Z","dependency_job_id":null,"html_url":"https://github.com/zeromq/JSMQ","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2FJSMQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2FJSMQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2FJSMQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2FJSMQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeromq","download_url":"https://codeload.github.com/zeromq/JSMQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252278968,"owners_count":21722796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T03:10:51.697Z","updated_at":"2025-05-04T02:31:54.849Z","avatar_url":"https://github.com/zeromq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSMQ\n====\n\nJSMQ is javascript client for ZeroMQ/NetMQ over WebSockets.\n\nZeroMQ and NetMQ don't have a WebSockets transport at the moment, however extensions already exist for [NetMQ](https://github.com/somdoron/NetMQ.WebSockets) and [CZMQ](https://github.com/ZeroMQ/zwssock).\n\nFor browsers without WebSockets support ([RFC6455](http://tools.ietf.org/html/rfc6455)) you can try to use [web-socket-js](https://github.com/gimite/web-socket-js).\n\nBoth JSMQ and NetMQ WebSockets are beta at the moment and the API and protocol will probably changed.\n\nThe JSMQ currently implement the dealer and subscriber patterns and the NetMQ WebSockets implement the router and publisher patterns.\n\nYou can download the JSMQ.JS file from this page or from [nuget](https://www.nuget.org/packages/JSMQ/), just search for JSMQ and include prerelease.\n\nUsing JSMQ is very similar to using other high level binding of ZeroMQ. Following is small example:\n\n```html\n\u003chtml\u003e\n    \u003cscript src=\"JSMQ.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        var dealer = new JSMQ.Dealer();\n        dealer.connect(\"ws://localhost\");\n\n        // we must wait for the dealer to be connected before we can send messages, any messages we are trying to send\n        // while the dealer is not connected will be dropped\n        dealer.sendReady = function() {\n            document.getElementById(\"sendButton\").disabled = \"\";\n        };\n\n        var subscriber = new JSMQ.Subscriber();\n        subscriber.connect(\"ws://localhost:81\");\n        subscriber.subscribe(\"chat\");\n\n        subscriber.onMessage = function (message) {\n            \n            // we ignore the first frame because it's topic\n            message.popString();\n\n            document.getElementById(\"chatTextArea\").value =\n                document.getElementById(\"chatTextArea\").value +\n                message.popString()  + \"\\n\";\n        };\n\n        dealer.onMessage = function (message) {\n            // the response from the server\n            alert(message.popString());\n        };\n\n        function send() {\n            var message = new JSMQ.Message();\n            message.addString(document.getElementById(\"messageTextBox\").value);\n            \n            dealer.send(message);\n        }\n    \u003c/script\u003e\n    \u003cbody\u003e                        \n        \u003ctextarea id=\"chatTextArea\" readonly=\"readonly\"\u003e\u003c/textarea\u003e\n        \u003cbr/\u003e\n        \u003clabel\u003eMessage:\u003c/label\u003e\u003cinput id=\"messageTextBox\" value=\"\" /\u003e\n        \u003cbutton id=\"sendButton\" disabled=\"disabled\" onclick=\"javascript:send();\"\u003e\n            Send\n        \u003c/button\u003e                    \n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fjsmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeromq%2Fjsmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fjsmq/lists"}