HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/whatsapp.dmstech.online/node_modules/xmlhttprequest-ssl/tests/server.js
var http = require("http");

var server = http.createServer(function (req, res) {
    switch (req.url) {
        case "/text":
            return res
                .writeHead(200, {"Content-Type": "text/plain"})
                .end("Hello world!");
        case "/xml":
            return res
                .writeHead(200, {"Content-Type": "application/xml"})
                .end("<element><child>Foobar</child></element>");
        case "/json":
            return res
                .writeHead(200, {"Content-Type": "application/json"})
                .end(JSON.stringify({ foo: "bar" }));
        case "/binary":
            return res
                .writeHead(200, {"Content-Type": "application/octet-stream"})
                .end(Buffer.from("Hello world!"));
        default:
            return res
                .writeHead(404, {"Content-Type": "text/plain"})
                .end("Not found");
    }
}).listen(8888);

process.on("SIGINT", function () {
    server.close();
});