Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-quic

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-quic - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "node-quic",
"version": "0.1.2",
"version": "0.1.3",
"description": "A wrapper around fidm/quic, node-quic is a dead simple stream based QUIC server / client for use in node.js.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -21,3 +21,3 @@ # node-quic

const port = 1234
const port = 1234
const address = '127.0.0.1' // default

@@ -82,2 +82,33 @@

For example:
```js
const port = 1234
const address = '127.0.0.1'
// First we listen.
quic.listen(port, address)
.onData((data, stream, buffer) => {
const parsedData = JSON.parse(data)
console.log(parsedData) // { hello: 'world!' }
// Once the data is received and logged, we'll send it right back
stream.write(parsedData)
})
// Now we send the data to the server.
quic.send(port, address, { hello: 'world!' })
.onData(data => {
// This is the data that was sent right back
const parsedData = JSON.parse(data)
console.log(parsedData) // { hello: 'world!' }
// now we can stop the server from listening if we want this to be a one-off
quic.stopListening()
})
```
Easy Peasy. Enjoy!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc