{"id":19797768,"url":"https://github.com/krlan2789/express-ws-app","last_synced_at":"2026-03-04T06:31:19.244Z","repository":{"id":195173175,"uuid":"692402634","full_name":"krlan2789/express-ws-app","owner":"krlan2789","description":"Express - WebSocket Server Application","archived":false,"fork":false,"pushed_at":"2025-06-17T09:26:52.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T10:31:19.112Z","etag":null,"topics":["expressjs","nodejs","postgresql","websocket","websocket-server"],"latest_commit_sha":null,"homepage":"https://erlankurnia.github.io/article/1/WebSocket%20Example%20Project","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krlan2789.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-16T11:18:26.000Z","updated_at":"2025-06-17T09:26:55.000Z","dependencies_parsed_at":"2024-11-10T21:18:38.160Z","dependency_job_id":"0735ed06-55f2-4790-806f-c176106db5ea","html_url":"https://github.com/krlan2789/express-ws-app","commit_stats":null,"previous_names":["krlan2789/express-ws-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krlan2789/express-ws-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlan2789%2Fexpress-ws-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlan2789%2Fexpress-ws-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlan2789%2Fexpress-ws-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlan2789%2Fexpress-ws-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krlan2789","download_url":"https://codeload.github.com/krlan2789/express-ws-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlan2789%2Fexpress-ws-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30074142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"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":["expressjs","nodejs","postgresql","websocket","websocket-server"],"created_at":"2024-11-12T07:26:46.082Z","updated_at":"2026-03-04T06:31:18.855Z","avatar_url":"https://github.com/krlan2789.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1. Express WebSocket App Example\n\n## 1.1. **Specs**\n\n- NodeJS `16.20.0`\n- NPM `8.19.4`\n- ExpressJS `4.17.1`\n- NodeJS WebSocket Library `8.2.3`\n- PostgreSQL `12.14`\n\n## 1.2. **Getting Started**\n\n1. Clone project repository :\n\n   ```shell\n   $ git clone https://github.com/krlan2789/express-ws-app.git\n   ```\n\n2. Switch to the project directory :\n\n   ```shell\n   $ cd express-wss-app\n   ```\n\n3. Install dependencies :\n\n   ```shell\n   $ npm install\n   or\n   $ npm i\n   ```\n\n## 1.3. **Database Configuration**\n\n1. Duplicate the `.env_example` or create new file, then rename it to `.env`.\n2. Change the value as needed :\n\n   ```ini\n   DB_HOST=localhost # database hostname or ip\n   DB_PORT=5432 # postgresql port\n   DB_NAME=postgres # database name\n   DB_USERNAME=root # database username\n   DB_PASSWORD=12345678 # database password\n\n   CONNECTION_PORT=8765 # node.js app port\n   ```\n\n## 1.4. **Running Applications**\n\n1. Switch to the project directory :\n\n   ```shell\n   $ cd express-wss-app\n   ```\n\n2. Start on development mode :\n\n   ```shell\n   $ npm run dev\n   ```\n\n3. Start on production mode :\n\n   ```shell\n   $ npm start\n   ```\n\n4. Start on production mode using pm2 ([required pm2 package](https://github.com/Unitech/pm2)) :\n\n   ```shell\n   $ npm start:pm2\n   ```\n\n5. Open browser, use websocket tester tools, then fill in the url with `[ws/wss]://[ip/hostname]:[port]?token=user_token`.\n\n   ```http\n   Example :\n\n   HTTP  -\u003e ws://localhost:8765?token=user1240635408404344554\n   HTTPS -\u003e wss://localhost:8765?token=user1240635408404344554\n   ```\n\n   Or, run `npm run test:ws` on terminal.\n\n6. Visit [this article](https://erlankurnia.github.io/note/2/WebSocket%20Service%20on%20VPS) to run the app on VPS/Cloud hosting/etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrlan2789%2Fexpress-ws-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrlan2789%2Fexpress-ws-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrlan2789%2Fexpress-ws-app/lists"}