v0.7.0
- 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)
This commit is contained in:
35
hacktv_updsrv/ServiceVault/wtv-flashrom/willie.async.js
Normal file
35
hacktv_updsrv/ServiceVault/wtv-flashrom/willie.async.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// 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();
|
||||
@@ -1,20 +0,0 @@
|
||||
// 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.
|
||||
|
||||
|
||||
const options = new URL('http://wtv.zefie.com/willie.php?flash='+getSessionData(socket_session_data[socket.id].ssid, 'wtv-client-rom-type'))
|
||||
var data_ready = false;
|
||||
data = '';
|
||||
const req = http.request(options, res => {
|
||||
console.log(`statusCode: ${res.statusCode}`)
|
||||
|
||||
res.on('data', d => {
|
||||
data += d;
|
||||
})
|
||||
|
||||
res.on('end', function () {
|
||||
data_ready = true;
|
||||
});
|
||||
});
|
||||
|
||||
headers = "200 OK\nContent-type: text/html";
|
||||
Reference in New Issue
Block a user