Add token + 2.0.4
This commit is contained in:
parent
b9aa613e1d
commit
f3c87e1c84
2 changed files with 3 additions and 3 deletions
|
@ -124,12 +124,12 @@ export class Client extends (EventEmitter as new () => TypedEmitter<MessageEvent
|
||||||
}).toBinary()
|
}).toBinary()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
constructor(url: string) {
|
constructor(url: string, token?: string) {
|
||||||
super();
|
super();
|
||||||
this.ws = new WebSocket(url.replace("http", "ws"), {
|
this.ws = new WebSocket(url.replace("http", "ws"), {
|
||||||
//@ts-expect-error
|
//@ts-expect-error
|
||||||
headers: {
|
headers: {
|
||||||
Origin: url,
|
Origin: url + (token ? ("?t=" + token) : ""),
|
||||||
"User-Agent": new UserAgent().toString(),
|
"User-Agent": new UserAgent().toString(),
|
||||||
},
|
},
|
||||||
protocol: "pianoverse",
|
protocol: "pianoverse",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "pianoverse",
|
"name": "pianoverse",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "v2.0.3",
|
"version": "v2.0.4",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"homepage": "https://git.sad.ovh/sophie/pianoverse",
|
"homepage": "https://git.sad.ovh/sophie/pianoverse",
|
||||||
"bugs": "https://git.sad.ovh/sophie/pianoverse/issues",
|
"bugs": "https://git.sad.ovh/sophie/pianoverse/issues",
|
||||||
|
|
Loading…
Reference in a new issue