v0.9.8
- fix: app.js: Use \r\n, fix connections= service setting - update: config.json: fix some service flags that were misset - Add ServiceFlags.txt: brief description of wtv-service flags - update: Moved tellyscripts to wtv-1800:/preregister - update: fixed bug where "send_tellyscript was undefined" - update: initial work on bf0app flashrom support (incomplete) - add wtv-1800:/offer-open-isp-suggest for dreamcast clients - fix: wtv-tricks:/info was not updated to use new ClientSessionData structure - update: app.js: add special filtering for Dreamcast clients - update: change default service logos
This commit is contained in:
16
ServiceFlags.txt
Normal file
16
ServiceFlags.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
wtv service flags:
|
||||||
|
DontEncryptRequests (Do not encrypt requests from client -> server)
|
||||||
|
UseHTTP (Instead of WTVP)
|
||||||
|
WideOpen (Allow untrusted links to this service)
|
||||||
|
UseServiceCookies (Pass service cookie to this service)
|
||||||
|
NoMeter (Dont meter this service)
|
||||||
|
|
||||||
|
0x00000001 = DontEncryptRequests
|
||||||
|
0x00000002 = UseHTTP (untested)
|
||||||
|
0x00000004 = WideOpen
|
||||||
|
0x00000007 = DontEncryptRequests + WideOpen + UseHTTP
|
||||||
|
0x00000010 = UseServiceCookies
|
||||||
|
0x00000040 = NoMeter
|
||||||
|
|
||||||
|
Note:
|
||||||
|
Service Cookies and Metering are not implemented in minisrv.
|
||||||
Binary file not shown.
@@ -1,78 +0,0 @@
|
|||||||
if (socket.ssid != null) {
|
|
||||||
if (!ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
|
||||||
ssid_sessions[socket.ssid].data_store.wtvsec_login = new WTVSec();
|
|
||||||
ssid_sessions[socket.ssid].data_store.wtvsec_login.IssueChallenge();
|
|
||||||
ssid_sessions[socket.ssid].data_store.wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log(" * Something bad happened (we don't know the client ssid???)");
|
|
||||||
var errpage = doErrorCode(400)
|
|
||||||
headers = errpage[0];
|
|
||||||
data = errpage[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
|
||||||
var prereg_contype = "text/html";
|
|
||||||
|
|
||||||
if (request_headers.query.relogin) { // relogin
|
|
||||||
ssid_sessions[socket.ssid].data_store.wtvsec_login.ticket_b64 = null; // clear old ticket
|
|
||||||
}
|
|
||||||
|
|
||||||
// if relogin and wtv-script-id != 0, skip tellyscript
|
|
||||||
var romtype, file_path = null;
|
|
||||||
var send_tellyscript = true;
|
|
||||||
var wtv_script_id = parseInt(ssid_sessions[socket.ssid].get("wtv-script-id"));
|
|
||||||
if (request_headers.query.relogin && wtv_script_id != 0) send_tellyscript = false;
|
|
||||||
if (send_tellyscript && minisrv_config.services[service_name].send_tellyscripts) {
|
|
||||||
if (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist) {
|
|
||||||
var send_telly_to_ssid = (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist.findIndex(element => element == socket.ssid) != -1)
|
|
||||||
if (send_telly_to_ssid) romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
|
||||||
} else {
|
|
||||||
romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (romtype) {
|
|
||||||
case "US-LC2-disk-0MB-8MB":
|
|
||||||
prereg_contype = "text/tellyscript";
|
|
||||||
// if wtv-open-access: true then client expects OpenISP
|
|
||||||
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/LC2/LC2_OISP_5555732_56k.tok";
|
|
||||||
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/LC2/LC2_WTV_18006138199_56k.tok";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
data = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
headers = `200 OK
|
|
||||||
Connection: Keep-Alive
|
|
||||||
wtv-initial-key: ` + ssid_sessions[socket.ssid].data_store.wtvsec_login.challenge_key.toString(CryptoJS.enc.Base64) + `
|
|
||||||
Content-Type: `+ prereg_contype + `
|
|
||||||
wtv-service: reset
|
|
||||||
` + getServiceString('wtv-1800') + `
|
|
||||||
` + getServiceString('wtv-star') + `
|
|
||||||
` + getServiceString('wtv-head-waiter') + `
|
|
||||||
` + getServiceString('wtv-flashrom') + `
|
|
||||||
wtv-boot-url: wtv-1800:/preregister?relogin=true
|
|
||||||
wtv-visit: wtv-head-waiter:/login?
|
|
||||||
wtv-client-time-zone: GMT -0000
|
|
||||||
wtv-client-time-dst-rule: GMT
|
|
||||||
wtv-client-date: `+ strftime("%a, %d %b %Y %H:%M:%S", new Date(new Date().toUTCString())) + ` GMT`;
|
|
||||||
|
|
||||||
if (file_path) {
|
|
||||||
request_is_async = true;
|
|
||||||
fs.readFile(file_path, null, function (err, file_read_data) {
|
|
||||||
if (err) {
|
|
||||||
var errmsg = doErrorCode(400);
|
|
||||||
headers = errmsg[0];
|
|
||||||
file_read_data = errmsg[1] + "\n" + err.toString();
|
|
||||||
}
|
|
||||||
sendToClient(socket, headers, file_read_data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var errpage = doErrorCode(400);
|
|
||||||
headers = errpage[0];
|
|
||||||
data = errpage[1];
|
|
||||||
}
|
|
||||||
49
zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js.meh
Normal file
49
zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js.meh
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
if (socket.ssid != null && !ssid_sessions[socket.ssid].get("wtvsec_login")) {
|
||||||
|
var wtvsec_login = new WTVSec();
|
||||||
|
wtvsec_login.IssueChallenge();
|
||||||
|
wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]);
|
||||||
|
ssid_sessions[socket.ssid].set("wtvsec_login", wtvsec_login);
|
||||||
|
} else if (socket.ssid != null) {
|
||||||
|
var wtvsec_login = ssid_sessions[socket.ssid].get("wtvsec_login");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wtvsec_login) {
|
||||||
|
|
||||||
|
|
||||||
|
headers = `200 OK
|
||||||
|
Connection: Keep-Alive
|
||||||
|
wtv-initial-key: ` + wtvsec_login.challenge_key.toString(CryptoJS.enc.Base64) + `
|
||||||
|
Content-Type: text/tellyscript
|
||||||
|
wtv-service: reset
|
||||||
|
` + getServiceString('wtv-head-waiter') + `
|
||||||
|
` + getServiceString('wtv-star') + `
|
||||||
|
` + getServiceString('wtv-flashrom') + `
|
||||||
|
wtv-boot-url: wtv-head-waiter:/login?
|
||||||
|
wtv-visit: wtv-head-waiter:/login?
|
||||||
|
wtv-client-time-zone: GMT -0000
|
||||||
|
wtv-client-time-dst-rule: GMT
|
||||||
|
wtv-client-date: `+ strftime("%a, %d %b %Y %H:%M:%S", new Date(new Date().toUTCString())) + ` GMT`;
|
||||||
|
|
||||||
|
var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/bf0app/bf0app_production_braindead";
|
||||||
|
//var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/LC2/LC2_OISP_5555732_56k.tok";
|
||||||
|
|
||||||
|
if (file_path) {
|
||||||
|
request_is_async = true;
|
||||||
|
fs.readFile(file_path, null, function (err, file_read_data) {
|
||||||
|
if (err) {
|
||||||
|
|
||||||
|
headers=`500 Some error occurred...`
|
||||||
|
}
|
||||||
|
sendToClient(socket, headers, file_read_data);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(" * Something bad happened (we don't know the client ssid???)");
|
||||||
|
headers=`500 missing ssid`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
var gourl = "wtv-1800:/finish-prereg?";
|
||||||
|
if (request_headers.query.relogin) gourl += "relogin=true";
|
||||||
|
|
||||||
|
|
||||||
|
if (request_headers["wtv-ticket"]) {
|
||||||
|
gourl = "wtv-head-waiter:/login-stage-two?";
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = `200 OK
|
||||||
|
Connection: Keep-Alive
|
||||||
|
wtv-expire-all: wtv-
|
||||||
|
wtv-open-isp-disabled: false
|
||||||
|
wtv-visit: `+ gourl + `
|
||||||
|
Content-type: text/html`;
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
var gourl = "wtv-1800:/finish-prereg?";
|
var gourl = "wtv-head-waiter:/login?";
|
||||||
if (request_headers.query.relogin) gourl += "relogin=true";
|
if (request_headers.query.relogin) gourl += "relogin=true";
|
||||||
|
var send_initial_key = true;
|
||||||
|
|
||||||
if (request_headers["wtv-ticket"]) {
|
|
||||||
gourl = "wtv-head-waiter:/login-stage-two?";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (socket.ssid) {
|
if (socket.ssid) {
|
||||||
if (ssid_sessions[socket.ssid].data_store) {
|
if (ssid_sessions[socket.ssid].data_store) {
|
||||||
@@ -19,17 +15,132 @@ if (socket.ssid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (i > 0 && zdebug) console.log(" # Closed", i, "previous sockets for", socket.ssid);
|
if (i > 0 && zdebug) console.log(" # Closed", i, "previous sockets for", filterSSID(socket.ssid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
||||||
delete ssid_sessions[socket.ssid].data_store.wtvsec_login;
|
delete ssid_sessions[socket.ssid].data_store.wtvsec_login;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ssid_sessions[socket.ssid].data_store.wtvsec_login = new WTVSec();
|
||||||
|
ssid_sessions[socket.ssid].data_store.wtvsec_login.IssueChallenge();
|
||||||
|
ssid_sessions[socket.ssid].data_store.wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]);
|
||||||
|
} else {
|
||||||
|
console.log(" * Something bad happened (we don't know the client ssid???)");
|
||||||
|
var errpage = doErrorCode(400)
|
||||||
|
headers = errpage[0];
|
||||||
|
data = errpage[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = `200 OK
|
if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
||||||
Connection: Keep-Alive
|
var prereg_contype = "text/html";
|
||||||
wtv-expire-all: wtv-
|
|
||||||
wtv-open-isp-disabled: false
|
if (request_headers.query.relogin) { // relogin
|
||||||
wtv-visit: `+ gourl + `
|
ssid_sessions[socket.ssid].data_store.wtvsec_login.ticket_b64 = null; // clear old ticket
|
||||||
Content-type: text/html`;
|
}
|
||||||
|
|
||||||
|
// if relogin and wtv-script-id != 0, skip tellyscript
|
||||||
|
var file_path = null;
|
||||||
|
var bf0app_update = false;
|
||||||
|
var romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
||||||
|
var send_tellyscripts = (minisrv_config.services[service_name].send_tellyscripts && !request_headers.query.relogin);
|
||||||
|
var wtv_script_id = parseInt(ssid_sessions[socket.ssid].get("wtv-script-id"));
|
||||||
|
var bootrom = ssid_sessions[socket.ssid].get("wtv-client-bootrom-version");
|
||||||
|
if (request_headers.query.relogin && wtv_script_id != 0) send_tellyscript = false;
|
||||||
|
if (send_tellyscripts) {
|
||||||
|
if (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist) {
|
||||||
|
var send_telly_to_ssid = (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist.findIndex(element => element == socket.ssid) != -1)
|
||||||
|
if (send_telly_to_ssid) {
|
||||||
|
romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (romtype) {
|
||||||
|
case "US-LC2-disk-0MB-8MB":
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
|
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/LC2/LC2_OISP_5555732_56k.tok";
|
||||||
|
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/LC2/lc2_production_normal.tok";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "US-LC2-disk-0MB-8MB-softmodem-CPU5230":
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
|
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/DERBY/derby_production_normal.tok";
|
||||||
|
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/DERBY/derby_production_normal.tok";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "US-WEBSTAR-disk-0MB-16MB-softmodem-CPU5230":
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
|
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/WEBSTAR/dishplayer_production_normal.tok";
|
||||||
|
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/WEBSTAR/dishplayer_production_normal.tok";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "JP-Fiji":
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
|
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/DC/dc_production_normal.tok";
|
||||||
|
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/DC/dc_production_normal.tok";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "bf0app":
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
|
if (ssid_sessions[socket.ssid].get("wtv-open-access") == "true") var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/BF0APP/bf0app_production_braindead.tok";
|
||||||
|
else var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/BF0APP/bf0app_production_braindead.tok";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
data = '';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!request_headers['wtv-client-rom-type'] && bootrom == "105") {
|
||||||
|
// assume old classic in flash mode, override user setting and send tellyscript
|
||||||
|
// because it is required to proceed in flash mode
|
||||||
|
prereg_contype = "text/tellyscript";
|
||||||
|
var file_path = __dirname + "/ServiceDeps/premade_tellyscripts/bf0app/bf0app_production_braindead.tok";
|
||||||
|
bf0app_update = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request_headers["wtv-ticket"]) {
|
||||||
|
gourl = "wtv-head-waiter:/login-stage-two?relogin=true";
|
||||||
|
send_initial_key = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = "200 OK\n"
|
||||||
|
headers += "Connection: Keep-Alive\n";
|
||||||
|
if (send_initial_key) headers += "wtv-initial-key: " + ssid_sessions[socket.ssid].data_store.wtvsec_login.challenge_key.toString(CryptoJS.enc.Base64) + "\n";
|
||||||
|
headers += "Content-Type: " + prereg_contype + "\n";
|
||||||
|
headers += "wtv-service: reset\n";
|
||||||
|
headers += getServiceString('wtv-1800') + "\n";
|
||||||
|
headers += getServiceString('wtv-star') + "\n";
|
||||||
|
if (!bf0app_update) headers += getServiceString('wtv-head-waiter') + "\n";
|
||||||
|
headers += getServiceString('wtv-flashrom') + "\n";
|
||||||
|
if (!bf0app_update) headers += "wtv-boot-url: wtv-1800:/preregister?relogin=true\n"
|
||||||
|
if (!bf0app_update) headers += "wtv-open-isp-disabled: false\n";
|
||||||
|
if (!bf0app_update) headers += "wtv-visit: "+gourl+"\n";
|
||||||
|
if (!bf0app_update) headers += "wtv-client-time-zone: GMT -0000\n";
|
||||||
|
if (!bf0app_update) headers += "wtv-client-time-dst-rule: GMT\n"
|
||||||
|
if (!bf0app_update) headers += "wtv-client-date: " + strftime("%a, %d %b %Y %H:%M:%S", new Date(new Date().toUTCString())) + " GMT";
|
||||||
|
|
||||||
|
if (file_path) {
|
||||||
|
request_is_async = true;
|
||||||
|
fs.readFile(file_path, null, function (err, file_read_data) {
|
||||||
|
if (err) {
|
||||||
|
var errmsg = doErrorCode(400);
|
||||||
|
headers = errmsg[0];
|
||||||
|
file_read_data = errmsg[1] + "\n" + err.toString();
|
||||||
|
}
|
||||||
|
sendToClient(socket, headers, file_read_data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var errpage = doErrorCode(400);
|
||||||
|
headers = errpage[0];
|
||||||
|
data = errpage[1];
|
||||||
|
}
|
||||||
@@ -22,8 +22,9 @@ function doLocalFlashROM(flashrom_file_path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
||||||
|
|
||||||
if (request_headers.query.raw) {
|
if (request_headers.query.raw || romtype == "bf0app") {
|
||||||
if ((/\.brom$/).test(request_path)) headers += "Content-Type: binary/x-wtv-bootrom"; // maybe?
|
if ((/\.brom$/).test(request_path)) headers += "Content-Type: binary/x-wtv-bootrom"; // maybe?
|
||||||
else headers += "Content-Type: binary/x-wtv-flashblock";
|
else headers += "Content-Type: binary/x-wtv-flashblock";
|
||||||
var flashrom_file_path = null;
|
var flashrom_file_path = null;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
if (request_headers.query.path) {
|
if (request_headers.query.path) {
|
||||||
|
var url = "wtv-flashrom:/get-lc2-page?path=" + request_headers.query.path;
|
||||||
|
var romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");
|
||||||
|
if (romtype == "bf0app") {
|
||||||
|
url = "client:updateflash?ipaddr="+minisrv_config.services[service_name].host+"&port="+minisrv_config.services[service_name].port+"&path=" + request_headers.query.path;
|
||||||
|
}
|
||||||
headers = "300 OK\n";
|
headers = "300 OK\n";
|
||||||
headers += "wtv-visit: wtv-flashrom:/get-lc2-page?path=" + request_headers.query.path + "\n";
|
headers += "wtv-visit: " + url + "\n";
|
||||||
headers += "Location: wtv-flashrom:/get-lc2-page?path=" + request_headers.query.path + "\n";
|
headers += "Location: " + url + "\n";
|
||||||
headers += "Content-type: text/html";
|
headers += "Content-type: text/html";
|
||||||
data = '';
|
data = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -2,8 +2,8 @@
|
|||||||
var client_caps = null;
|
var client_caps = null;
|
||||||
|
|
||||||
if (socket.ssid != null) {
|
if (socket.ssid != null) {
|
||||||
if (ssid_sessions[socket.ssid].data_store.capabilities) {
|
if (ssid_sessions[socket.ssid].capabilities) {
|
||||||
client_caps = ssid_sessions[socket.ssid].data_store.capabilities;
|
client_caps = ssid_sessions[socket.ssid].capabilities;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (client_caps) {
|
if (client_caps) {
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ function filterSSID(obj) {
|
|||||||
if (typeof (obj) == "string") {
|
if (typeof (obj) == "string") {
|
||||||
if (obj.substr(0, 8) == "MSTVSIMU") {
|
if (obj.substr(0, 8) == "MSTVSIMU") {
|
||||||
return obj.substr(0, 10) + ('*').repeat(10) + obj.substr(20);
|
return obj.substr(0, 10) + ('*').repeat(10) + obj.substr(20);
|
||||||
|
} else if (obj.substr(0, 5) == "1SEGA") {
|
||||||
|
return obj.substr(0, 6) + ('*').repeat(6) + obj.substr(13);
|
||||||
} else {
|
} else {
|
||||||
return obj.substr(0, 6) + ('*').repeat(9);
|
return obj.substr(0, 6) + ('*').repeat(9);
|
||||||
}
|
}
|
||||||
@@ -204,6 +206,8 @@ function filterSSID(obj) {
|
|||||||
var ssid = obj["wtv-client-serial-number"];
|
var ssid = obj["wtv-client-serial-number"];
|
||||||
if (ssid.substr(0, 8) == "MSTVSIMU") {
|
if (ssid.substr(0, 8) == "MSTVSIMU") {
|
||||||
obj["wtv-client-serial-number"] = ssid.substr(0, 10) + ('*').repeat(10) + ssid.substr(20);
|
obj["wtv-client-serial-number"] = ssid.substr(0, 10) + ('*').repeat(10) + ssid.substr(20);
|
||||||
|
} else if (ssid.substr(0, 5) == "1SEGA") {
|
||||||
|
obj["wtv-client-serial-number"] = ssid.substr(0, 6) + ('*').repeat(6) + ssid.substr(13);
|
||||||
} else {
|
} else {
|
||||||
obj["wtv-client-serial-number"] = ssid.substr(0, 6) + ('*').repeat(9);
|
obj["wtv-client-serial-number"] = ssid.substr(0, 6) + ('*').repeat(9);
|
||||||
}
|
}
|
||||||
@@ -490,9 +494,9 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
} else {
|
} else {
|
||||||
if (k.indexOf('_') >= 0) {
|
if (k.indexOf('_') >= 0) {
|
||||||
var j = k.split('_')[0];
|
var j = k.split('_')[0];
|
||||||
headers += j + ": " + headers_obj[k] + "\n";
|
headers += j + ": " + headers_obj[k] + "\r\n";
|
||||||
} else {
|
} else {
|
||||||
headers += k + ": " + headers_obj[k] + "\n";
|
headers += k + ": " + headers_obj[k] + "\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -501,17 +505,17 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
// send to client
|
// send to client
|
||||||
var toClient = null;
|
var toClient = null;
|
||||||
if (typeof data == 'string') {
|
if (typeof data == 'string') {
|
||||||
toClient = headers + "\n" + data;
|
toClient = headers + "\r\n" + data;
|
||||||
socket.write(toClient);
|
socket.write(toClient);
|
||||||
} else if (typeof data == 'object') {
|
} else if (typeof data == 'object') {
|
||||||
if (zquiet) var verbosity_mod = (headers_obj["wtv-encrypted"] == 'true') ? " encrypted response" : "";
|
if (zquiet) var verbosity_mod = (headers_obj["wtv-encrypted"] == 'true') ? " encrypted response" : "";
|
||||||
if (socket_sessions[socket.id].secure_headers == true) {
|
if (socket_sessions[socket.id].secure_headers == true) {
|
||||||
// encrypt headers
|
// encrypt headers
|
||||||
if (zquiet)verbosity_mod += " with encrypted headers";
|
if (zquiet)verbosity_mod += " with encrypted headers";
|
||||||
var enc_headers = socket_sessions[socket.id].wtvsec.Encrypt(1, headers + "\n");
|
var enc_headers = socket_sessions[socket.id].wtvsec.Encrypt(1, headers + "\r\n");
|
||||||
socket.write(new Uint8Array(concatArrayBuffer(enc_headers, data)));
|
socket.write(new Uint8Array(concatArrayBuffer(enc_headers, data)));
|
||||||
} else {
|
} else {
|
||||||
socket.write(new Uint8Array(concatArrayBuffer(Buffer.from(headers + "\n"), data)));
|
socket.write(new Uint8Array(concatArrayBuffer(Buffer.from(headers + "\r\n"), data)));
|
||||||
}
|
}
|
||||||
if (zquiet) console.log(" * Sent" + verbosity_mod + " " + headers_obj.http_response + " to client (Content-Type:", headers_obj['Content-Type'], "~", headers_obj['Content-Length'], "bytes)");
|
if (zquiet) console.log(" * Sent" + verbosity_mod + " " + headers_obj.http_response + " to client (Content-Type:", headers_obj['Content-Type'], "~", headers_obj['Content-Length'], "bytes)");
|
||||||
}
|
}
|
||||||
@@ -1217,11 +1221,11 @@ Object.keys(minisrv_config.services).forEach(function (k) {
|
|||||||
minisrv_config.services[k].toString = function () {
|
minisrv_config.services[k].toString = function () {
|
||||||
var outstr = "wtv-service: name=" + this.name + " host=" + this.host + " port=" + this.port;
|
var outstr = "wtv-service: name=" + this.name + " host=" + this.host + " port=" + this.port;
|
||||||
if (this.flags) outstr += " flags=" + this.flags;
|
if (this.flags) outstr += " flags=" + this.flags;
|
||||||
if (this.connections) outstr += " flags=" + this.connections;
|
if (this.connections) outstr += " connections=" + this.connections;
|
||||||
if (k == "wtv-star") {
|
if (k == "wtv-star") {
|
||||||
outstr += "\nwtv-service: name=wtv-* host=" + this.host + " port=" + this.port;
|
outstr += "\nwtv-service: name=wtv-* host=" + this.host + " port=" + this.port;
|
||||||
if (this.flags) outstr += " flags=" + this.flags;
|
if (this.flags) outstr += " flags=" + this.flags;
|
||||||
if (this.connections) outstr += " flags=" + this.connections;
|
if (this.connections) outstr += " connections=" + this.connections;
|
||||||
}
|
}
|
||||||
return outstr;
|
return outstr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
"UserServiceVault",
|
"UserServiceVault",
|
||||||
"ServiceVault"
|
"ServiceVault"
|
||||||
],
|
],
|
||||||
"service_name": "MSNTV",
|
"service_name": "WebTV",
|
||||||
"service_logo": "MSNLogo.gif",
|
"service_logo": "WebTVLogoJewel.gif",
|
||||||
"service_splash_logo": "splash_logo_msn.gif",
|
"service_splash_logo": "file://ROM/images/SplashLogo1.gif",
|
||||||
"hide_ssid_in_logs": true,
|
"hide_ssid_in_logs": true,
|
||||||
"post_percentages": [ 0, 25, 50, 100 ],
|
"post_percentages": [ 0, 25, 50, 100 ],
|
||||||
"verbosity": 2,
|
"verbosity": 2,
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
"wtv-1800": {
|
"wtv-1800": {
|
||||||
"port": 1615,
|
"port": 1615,
|
||||||
"connections": 1,
|
"connections": 1,
|
||||||
|
"flags": "0x00000004",
|
||||||
"send_tellyscripts": false
|
"send_tellyscripts": false
|
||||||
},
|
},
|
||||||
"wtv-star": {
|
"wtv-star": {
|
||||||
@@ -25,12 +26,10 @@
|
|||||||
},
|
},
|
||||||
"wtv-head-waiter": {
|
"wtv-head-waiter": {
|
||||||
"port": 1601,
|
"port": 1601,
|
||||||
"flags": "0x00000001",
|
|
||||||
"connections": 1
|
"connections": 1
|
||||||
},
|
},
|
||||||
"wtv-update": {
|
"wtv-update": {
|
||||||
"port": 1619,
|
"port": 1635,
|
||||||
"flags": "0x04",
|
|
||||||
"connections": 3
|
"connections": 3
|
||||||
},
|
},
|
||||||
"wtv-log": {
|
"wtv-log": {
|
||||||
@@ -39,8 +38,7 @@
|
|||||||
"write_logs_to_disk": false
|
"write_logs_to_disk": false
|
||||||
},
|
},
|
||||||
"wtv-home": {
|
"wtv-home": {
|
||||||
"port": 1612,
|
"port": 1612
|
||||||
"flags": "0x00000010"
|
|
||||||
},
|
},
|
||||||
"wtv-tricks": {
|
"wtv-tricks": {
|
||||||
"port": 1602,
|
"port": 1602,
|
||||||
@@ -53,7 +51,6 @@
|
|||||||
},
|
},
|
||||||
"wtv-music": {
|
"wtv-music": {
|
||||||
"port": 1656,
|
"port": 1656,
|
||||||
"flags": "0x04",
|
|
||||||
"connections": 3
|
"connections": 3
|
||||||
},
|
},
|
||||||
"wtv-setup": {
|
"wtv-setup": {
|
||||||
@@ -63,8 +60,7 @@
|
|||||||
},
|
},
|
||||||
"wtv-chat": {
|
"wtv-chat": {
|
||||||
"port": 1630,
|
"port": 1630,
|
||||||
"connections": 3,
|
"connections": 3
|
||||||
"flags": "0x00000010"
|
|
||||||
},
|
},
|
||||||
"http": {
|
"http": {
|
||||||
"port": 1650,
|
"port": 1650,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "zefie_wtvp_minisrv",
|
"name": "zefie_wtvp_minisrv",
|
||||||
"version": "0.9.7",
|
"version": "0.9.8",
|
||||||
"description": "WebTV Service (WTVP) Emulation Server",
|
"description": "WebTV Service (WTVP) Emulation Server",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"homepage": "https://github.com/zefie/zefie_wtvp_minisrv",
|
"homepage": "https://github.com/zefie/zefie_wtvp_minisrv",
|
||||||
|
|||||||
@@ -200,7 +200,6 @@
|
|||||||
<Content Include="ServiceVault\wtv-update\DealerDemo.js" />
|
<Content Include="ServiceVault\wtv-update\DealerDemo.js" />
|
||||||
<Content Include="ServiceVault\wtv-home\home.js" />
|
<Content Include="ServiceVault\wtv-home\home.js" />
|
||||||
<Content Include="ServiceVault\wtv-update\updatesuccess.txt" />
|
<Content Include="ServiceVault\wtv-update\updatesuccess.txt" />
|
||||||
<Content Include="ServiceVault\wtv-1800\finish-prereg.js" />
|
|
||||||
<Content Include="ServiceVault\wtv-1800\preregister.js" />
|
<Content Include="ServiceVault\wtv-1800\preregister.js" />
|
||||||
<Content Include="ServiceVault\wtv-head-waiter\finalize-security.js" />
|
<Content Include="ServiceVault\wtv-head-waiter\finalize-security.js" />
|
||||||
<Content Include="ServiceVault\wtv-head-waiter\login-stage-two.js" />
|
<Content Include="ServiceVault\wtv-head-waiter\login-stage-two.js" />
|
||||||
|
|||||||
Reference in New Issue
Block a user