mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 22: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
|
@ -56,7 +56,11 @@ class CurlWebSocket extends CurlSession {
|
|||
request_options._libcurl_verbose = 1;
|
||||
}
|
||||
|
||||
this.http_handle = this.create_request(this.url, data_callback, finish_callback, headers_callback);
|
||||
let url_obj = new URL(this.url);
|
||||
let tls = url_obj.protocol === "wss:";
|
||||
request_options.headers["Host"] = url_obj.host;
|
||||
|
||||
this.http_handle = this.create_request(this.url, data_callback, finish_callback, headers_callback, tls);
|
||||
c_func(_http_set_options, [this.http_handle, JSON.stringify(request_options), null, 0]);
|
||||
_websocket_set_options(this.http_handle);
|
||||
if (this.options.proxy) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue