Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create tinyws project (websocket framework based on tinyhttp) #113

Closed
talentlessguy opened this issue Oct 3, 2020 · 2 comments
Closed
Labels
enhancement New feature or request medium

Comments

@talentlessguy
Copy link
Member

talentlessguy commented Oct 3, 2020

Create a WebSocket wrapper for tinyhttp, similar to express-ws and express-ws-routes

Usage will be something like this:

import { App } from 'tinyws'

const app = new App() 

app.ws('/abc', (ws, req) => {
    ws.on('message', msg => {
    ws.send(msg)
  })
})

If you have a better idea of how the usage should like, share in the thread

Implementation details

App must extend Router from '@tinyhttp/router'

If possible, it shouldn't depend on extra modules. But if not, then ws can be used.

@talentlessguy
Copy link
Member Author

Another suggestion is to build a standalone WebSocket framework based on tinyhttp

I already have a name... "tinyws" lol

@tinyhttp/router doesn't use an http server so it's possible to build such framework

@talentlessguy talentlessguy changed the title Create @tinyhttp/ws package Create tinyws project (websocket framework based on tinyhttp) Oct 6, 2020
@talentlessguy talentlessguy added the enhancement New feature or request label Oct 6, 2020
@talentlessguy
Copy link
Member Author

not going to work on it but if anyone wants i can help with the @tinyhttp/router package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium
Projects
None yet
Development

No branches or pull requests

1 participant