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 ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilities for testing WebSocket #3185

Open
nakasyouopened this issue Jul 24, 2024 · 0 comments
Open

Utilities for testing WebSocket #3185

nakasyouopened this issue Jul 24, 2024 · 0 comments
Labels
enhancement New feature or request.

Comments

@nakasyou
Copy link
Contributor

What is the feature you are proposing?

It might be good to have utilities that can test WebSocket.

For example:

import{createWebSocketHelperAndClient}from'hono/ws'

const{upgradeWebSocket,connect}=createWebSocketHelperAndClient()
app.get('/ws',upgradeWebSocket((c)=>({...})))

constws=connect()// create client

ws.onopen=()=>...
ws.onmessage=()=>...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

1 participant