client.js 349 B

12345678910111213141516171819
  1. const net = require("net");
  2. let socketPath = require("./dst/utils/socketPath").default;
  3. socketPath = socketPath();
  4. let con = net.createConnection(socketPath);
  5. con.write("register;close;");
  6. let buff = "";
  7. con.on("data", d => {
  8. buff += d.toString();
  9. // console.log(d.toString());
  10. con.end();
  11. });
  12. con.on("close", ()=>{
  13. console.log(buff);
  14. })