{"id":15284308,"url":"https://github.com/aitthi/tcpress-rs","last_synced_at":"2026-01-05T11:46:39.778Z","repository":{"id":65329918,"uuid":"582099467","full_name":"Aitthi/tcpress-rs","owner":"Aitthi","description":"A web framework written in Rust for javascript runtime.","archived":false,"fork":false,"pushed_at":"2023-08-12T05:58:47.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:46:35.677Z","etag":null,"topics":["http","rust","tcp","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aitthi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","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}},"created_at":"2022-12-25T17:10:41.000Z","updated_at":"2023-05-01T15:49:15.000Z","dependencies_parsed_at":"2024-10-14T14:41:52.555Z","dependency_job_id":"6eb14db6-7d57-45e8-b029-49fc2ff80eae","html_url":"https://github.com/Aitthi/tcpress-rs","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"0d1cb11f1c41082d7831e2cec4267ef14415ed11"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Ftcpress-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Ftcpress-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Ftcpress-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aitthi%2Ftcpress-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aitthi","download_url":"https://codeload.github.com/Aitthi/tcpress-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245138294,"owners_count":20566912,"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":["http","rust","tcp","wasm"],"created_at":"2024-09-30T14:53:13.347Z","updated_at":"2026-01-05T11:46:39.723Z","avatar_url":"https://github.com/Aitthi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCPress **Experimental**\n\n[![NPM version](https://img.shields.io/npm/v/tcpress-rs.svg?style=for-the-badge)](https://www.npmjs.com/package/tcpress-rs)\n\nA web framework written in Rust for javascript runtime.\n\n## Installation and Usage in NodeJs\n\n```bash\nnpm install tcpress-rs\n```\nor\n```bash\nyarn add tcpress-rs\n```\n\n```ts\nimport { TCPress, Response, Request } from 'tcpress-rs';\nimport net from 'net'\n\nconst port = 7070;\nconst host = '0.0.0.0';\nlet app = new TCPress();\nlet sleep = (ms: number) =\u003e new Promise(resolve =\u003e setTimeout(resolve, ms));\n// app\napp.get(\"/\", [async (req: Request, res: Response, next: Function)=\u003e{\n    req.set(\"test\", \"app state 1\");\n    res.header(\"Powered-By\", \"TCPress\")\n    // await sleep(100);\n    next();\n}, async (req: Request, res: Response)=\u003e{\n    console.log(\"state test\", req.get(\"test\"));\n    // console.log(\"headers\", req.headers());\n    // console.log(\"raw_body\", req.body().raw_body());\n    res.status(200).json({\n        status: 200,\n        message: \"Hello World\",\n    });\n}])\n\n// uncaughtException\nprocess.on('uncaughtException', function (err) {\n    console.log(err);\n});\n\n// Tcpress + NodejsTCP\nconst server = net.createServer();\nfunction sv(){\n    server.listen(port, host, () =\u003e {\n        console.log('TCP Server is running on port ' + port +'.');\n    });\n    server.on('connection', (sock) =\u003e {\n        sock.on('data', (data) =\u003e {\n            app.http(data, (res: Uint8Array)=\u003esock.write(res))\n        });\n    });\n}\nsv();\n```\n\n## Usage in Bun.sh\n```ts\nimport { TCPress, Response, Request } from \"tcpress-rs\";\n\nconst port = 7070;\nconst host = '0.0.0.0';\nlet app = new TCPress();\nlet sleep = (ms: number) =\u003e new Promise(resolve =\u003e setTimeout(resolve, ms));\n// app\napp.get(\"/\", [async (req: Request, res: Response, next: Function) =\u003e {\n    req.set(\"test\", \"app state 1\");\n    res.header(\"Powered-By\", \"TCPress\")\n    // await sleep(100);\n    next();\n}, async (req: Request, res: Response) =\u003e {\n    console.log(\"state test\", req.get(\"test\"));\n    // console.log(\"headers\", req.headers());\n    // console.log(\"raw_body\", req.body().raw_body());\n    res.status(200).json({\n        status: 200,\n        message: \"Hello World\",\n    });\n}])\n\n// uncaughtException\nprocess.on('uncaughtException', function (err) {\n    console.log(err);\n});\nconsole.log('TCP Server is running on port ' + port +'.');\n// Tcpress + BunTCP\nBun.listen({\n    hostname: host,\n    port: port,\n    socket: {\n        data(sock, data) {\n            app.http(data, (res: Uint8Array) =\u003e sock.write(res))\n        }\n    }\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitthi%2Ftcpress-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitthi%2Ftcpress-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitthi%2Ftcpress-rs/lists"}