Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

  1. var dgram = require("dgram");
  2. (function() {
  3. var server = dgram.createSocket("udp4");
  4. server.on("error", function(err) {
  5. console.log("server error:\n" + err.stack);
  6. });
  7. server.on("message", function(msg, rinfo) {
  8. // eStats server
  9. server.send(msg, 0, msg.length, 33702, "176.31.211.227");
  10. // HLTV server
  11. server.send(msg, 0, msg.length, 30001, "web5.hltv.org");
  12. console.log(rinfo.address + ":" + rinfo.port, msg.toString());
  13. });
  14. server.on("listening", function() {
  15. var address = server.address();
  16. console.log("server listening " + address.address + ":" + address.port);
  17. });
  18. server.bind(10000);
  19. })();
  20. (function() {
  21. var server = dgram.createSocket("udp4");
  22. server.on("error", function(err) {
  23. console.log("server error:\n" + err.stack);
  24. });
  25. server.on("message", function(msg, rinfo) {
  26. // eStats server
  27. server.send(msg, 0, msg.length, 33702, "176.31.211.227");
  28. // HLTV server
  29. server.send(msg, 0, msg.length, 30001, "web5.hltv.org");
  30. console.log(rinfo.address + ":" + rinfo.port, msg.toString());
  31. });
  32. server.on("listening", function() {
  33. var address = server.address();
  34. console.log("server listening " + address.address + ":" + address.port);
  35. });
  36. server.bind(10001);
  37. })();