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

add webSocket example #2626

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
Mert Can Altin committed Jan 18, 2024
commit c6895f43f60f0a40f2054a884ccf21b8f4453ae4
8 changes: 4 additions & 4 deletions examples/proxy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ async function run () {
// WebSocket client
const ws = new WebSocket('ws://localhost:4002')
ws.on('open', () => {
ws.send('Hello, WebSocket Server!');
});
ws.send('Hello, WebSocket Server!')
})

ws.on('message', message => {
console.log(`WebSocket Server says: ${message}`)
ws.close();
});
ws.close()
})
}

run()
Loading