{"id":15705985,"url":"https://github.com/delucis/n4m-socket-demo","last_synced_at":"2026-02-16T09:37:40.548Z","repository":{"id":138048154,"uuid":"151355423","full_name":"delucis/n4m-socket-demo","owner":"delucis","description":"🚇 An example of how to use websockets with Node for Max","archived":false,"fork":false,"pushed_at":"2020-09-02T16:55:58.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T13:36:39.181Z","etag":null,"topics":["nodeformax","websockets"],"latest_commit_sha":null,"homepage":"","language":"Max","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delucis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2018-10-03T03:21:53.000Z","updated_at":"2023-09-11T03:43:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"9653a143-72aa-422a-a512-727af06a3e2d","html_url":"https://github.com/delucis/n4m-socket-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/delucis/n4m-socket-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delucis%2Fn4m-socket-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delucis%2Fn4m-socket-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delucis%2Fn4m-socket-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delucis%2Fn4m-socket-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delucis","download_url":"https://codeload.github.com/delucis/n4m-socket-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delucis%2Fn4m-socket-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29504896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: 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":["nodeformax","websockets"],"created_at":"2024-10-03T20:20:56.361Z","updated_at":"2026-02-16T09:37:40.529Z","avatar_url":"https://github.com/delucis.png","language":"Max","funding_links":[],"categories":[],"sub_categories":[],"readme":"# n4m-socket-demo\n\nThis repository demonstrates how to use Node for Max to create a simple websockets application with [`express`][xprss], [`socket.io`][sckt], and a public URL via [`ngrok`][ngrk].\n\nBe sure to also check out the examples in the official [Cycling ’74 `n4m-examples` repository][c74]!\n\n## Set-up\n\n1. Download this repository and open `index.maxpat`.\n    ```sh\n    # using the command line:\n    git clone https://github.com/delucis/n4m-socket-demo.git\n    cd n4m-socket-demo\n    open index.maxpat\n    ```\n\n2. In Max, click the `script npm install` message button to install the dependencies for this repository. (You could also do this from the command line by running `npm install` in the repository directory).\n\n3. Press `script start` to launch the web server and create a tunnel to ngrok.\n\n4. Open your browser to \u003chttp://0.0.0.0:3000\u003e or the ngrok URL displayed on-screen\n\n5. Try typing and sending messages using the browser interface. You should be able to receive them inside Max. Hooray! 🎉\n\n## Authenticating with `ngrok`\n\n`ngrok` allows you to sign up and then authenticate your session using a secret token. It would be a bad idea to commit that to GitHub, because then everyone would see your secrets 😱\n\nInstead, we can have our `index.js` code look for an “environment variable” (available as a property of the `process.env` global variable in Node) and use that if available.\n\nBy default this example will not authenticate with `ngrok` and is therefore subject to certain restrictions. To provide a secret token create a file called `.env` in the root directory of this repository and add the following line:\n\n```\nNGROK_TOKEN=MyVerySecretTokenFromNgrok\n```\n\nThis example uses the [`dotenv` Node package][.env] to load the variables declared in your `.env` file into the environment variables. As mentioned above, _**do not upload your secrets to GitHub**_.\n\nTo get a token you should [sign up for an ngrok account][ngrknew]. Once you have an account, [go get your authtoken][ngrkauth].\n\n[c74]: https://github.com/Cycling74/n4m-examples\n[ngrk]: https://ngrok.com/\n[ngrknew]: https://dashboard.ngrok.com/user/signup\n[ngrkauth]: https://dashboard.ngrok.com/auth\n[sckt]: https://socket.io/\n[xprss]: https://expressjs.com/\n[.env]: https://www.npmjs.com/package/dotenv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelucis%2Fn4m-socket-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelucis%2Fn4m-socket-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelucis%2Fn4m-socket-demo/lists"}