forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Jiawen Geng edited this page Aug 21, 2020
·
2 revisions
const { createQuicSocket } = require('net')
const url = 'quic.rocks'
const socket = createQuicSocket({ endpoint: { port: 4433 } })
async function main() {
const client = await socket.connect({
address: url,
port: 4433,
})
client.on('secure', () => {
console.log('secure')
})
client.on('error', (error) => {
console.log(error)
})
}
main().catch((e) => {
console.error(e)
})