Skip to content
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)
})
Clone this wiki locally