How to use the node-dtls-client.dtls.Socket function in node-dtls-client

To help you get started, we’ve selected a few node-dtls-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AlCalzone / node-coap-client / src / lib / SocketWrapper.ts View on Github external
constructor(public socket: dtls.Socket | dgram.Socket) {
		super();
		this.isDtls = (socket instanceof dtls.Socket);
		(socket as any)
			.on("message", (message: Buffer, rinfo: dgram.RemoteInfo) => {
				this.emit("message", message, rinfo);
			})
			.on("error", (err: Error) => {
				this.emit("error", err);
			})
			.on("close", () => {
				this.emit("close");
			})
			;
	}

node-dtls-client

DTLS protocol implementation for Node.js written in TypeScript.

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis