Skip to content

Instantly share code, notes, and snippets.

@seeya
Created September 25, 2020 10:41
Show Gist options
  • Save seeya/9b71235c08b5664f86a53736931ec9d7 to your computer and use it in GitHub Desktop.
Save seeya/9b71235c08b5664f86a53736931ec9d7 to your computer and use it in GitHub Desktop.
Reverse HTTP Server
const http = require("http");
const token = "ACCESSTOKEN";
const deviceMAC = "00:00:00:00:00"
const remoteServer = "139.59.236.228:4445"
http.createServer((req, res) => {
if(!req.headers.authorization || req.headers.authorization !== "Bearer " + token)
return res.end("Unauthorized");
res.end(decodeURIComponent(`${deviceMAC}${remoteServer}`));
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment