Add host/port "switchboard" module
Centrally list all hostnames and port numbers here. Need to push this into IDZ further but I'm a bit short on time (so what else is new).
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
import { createSocket } from "dgram";
|
||||
|
||||
export default function createPing(port: number) {
|
||||
export default function createPing(port: number, host: string) {
|
||||
const socket = createSocket("udp4");
|
||||
|
||||
socket.bind(port);
|
||||
socket.bind(port, host);
|
||||
socket.on("message", (msg, rinfo) => {
|
||||
console.log(`Idz Ping: Ping from ${rinfo.address}:${rinfo.port}`);
|
||||
socket.send(msg, rinfo.port, rinfo.address);
|
||||
|
||||
Reference in New Issue
Block a user