- Async support - Added RMF content-type - Better file extension detection - Clarify installation instructions - Update README.md - Remove encryption keys from wtv-home:/home - Decode URI for support for files with urlencoded elements - Fixed MSTV Sim compatiblity - Fix a typo - Add nobind feature to configure external services - Add url accessor to wtv-home:/home for non-internal builds - Add wtv-tricks:/access?url= - Very initial HTTP Proxy work (won't work yet)
36 lines
866 B
JavaScript
36 lines
866 B
JavaScript
// willie is just a graphical frontend to a list of ROMs
|
|
// the rest of the scripts should work if you manually link to a ROM, and actually have it.
|
|
|
|
|
|
var proxy_query = '';
|
|
if (query['flash']) delete query['flash'];
|
|
if (query['vflash']) delete query['vflash'];
|
|
|
|
for (const [key, value] of Object.entries(query)) {
|
|
proxy_query += "&" + key + "=" + value;
|
|
}
|
|
|
|
console.log(proxy_query);
|
|
|
|
var options = {
|
|
host: "wtv.zefie.com",
|
|
path: "/willie.php?pflash=" + getSessionData(socket_session_data[socket.id].ssid, 'wtv-client-rom-type') + proxy_query,
|
|
method: 'GET'
|
|
}
|
|
|
|
|
|
headers = "200 OK\nContent-type: text/html";
|
|
const req = http.request(options, function (res) {
|
|
data = '';
|
|
console.log(` * Upstream HTTP StatusCode: ${res.statusCode}`)
|
|
|
|
res.on('data', d => {
|
|
data += d;
|
|
})
|
|
|
|
res.on('end', function () {
|
|
sendToClient(socket, headers, data);
|
|
});
|
|
});
|
|
req.end();
|