mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-16 15:40:01 -04:00
fix url handling and websockets
This commit is contained in:
parent
0cab209e9d
commit
2e6fba2c3b
8 changed files with 67 additions and 13 deletions
|
@ -68,9 +68,6 @@ export class ReclaimTLSSocket extends EventTarget {
|
|||
|
||||
//set up socket callbacks
|
||||
this.socket.binaryType = "arraybuffer";
|
||||
this.socket.onopen = () => {
|
||||
this.tls.startHandshake();
|
||||
}
|
||||
this.socket.onmessage = (event) => {
|
||||
this.tls.handleReceivedBytes(new Uint8Array(event.data));
|
||||
}
|
||||
|
@ -82,6 +79,14 @@ export class ReclaimTLSSocket extends EventTarget {
|
|||
this.status = this.CLOSED;
|
||||
this.emit_event(new Event("error"));
|
||||
}
|
||||
if (this.socket.readyState === this.socket.CONNECTING) {
|
||||
this.socket.onopen = () => {
|
||||
this.tls.startHandshake();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.tls.startHandshake();
|
||||
}
|
||||
this.status = this.CONNECTING;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue