node-tunfd
It makes tun/tap interfaces.
How to use
const tunfd = ;const fs = ; let iface = // optional, kernel will automatically assign a name if not given here name: 'tun0' // can be either "tun" or "tap", default is "tun" // tun mode gets you ip packets, tap mode gets you ethernet frames mode: 'tun' // set to true if you want the 4-byte packet information header // default is false, which adds IFF_NO_PI to ifr_flags pi: false; // if you want to know the auto-assigned name of the interfaceconsole;// the fd of the new interfaceconsole; // how to get packetslet readStream = fs;readStream;// how to put packetslet writeStream = fs;writeStream; // fork()console;
License
ISC