fix 403
This commit is contained in:
parent
41a1f0533f
commit
6b29918703
|
@ -74,13 +74,13 @@ Client.prototype.connect = function() {
|
||||||
return;
|
return;
|
||||||
this.emit("status", "Connecting...");
|
this.emit("status", "Connecting...");
|
||||||
if(typeof module !== "undefined") {
|
if(typeof module !== "undefined") {
|
||||||
// nodejsicle
|
let headers = {
|
||||||
this.ws = new WebSocket(this.uri, {
|
|
||||||
headers: {
|
|
||||||
"origin": `https://${new URL(this.uri).host}`,
|
"origin": `https://${new URL(this.uri).host}`,
|
||||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36"
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36"
|
||||||
}
|
};
|
||||||
});
|
if (this.uri.includes("multiplayerpiano.com")) headers["X-Forwarded-For"] = `${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}`;
|
||||||
|
// nodejsicle
|
||||||
|
this.ws = new WebSocket(this.uri, {headers});
|
||||||
} else {
|
} else {
|
||||||
// browseroni
|
// browseroni
|
||||||
this.ws = new WebSocket(this.uri);
|
this.ws = new WebSocket(this.uri);
|
||||||
|
|
Loading…
Reference in New Issue