Proxy fixed
This commit is contained in:
parent
545e98904b
commit
a97ea2cf9c
@ -42,7 +42,7 @@ export class Proxy {
|
|||||||
private onConnect() {
|
private onConnect() {
|
||||||
this.socket.write(
|
this.socket.write(
|
||||||
`${this.options.method} ${this.parsed_url.pathname}${this.parsed_url.search} HTTP/1.1\r\n` +
|
`${this.options.method} ${this.parsed_url.pathname}${this.parsed_url.search} HTTP/1.1\r\n` +
|
||||||
`Host : ${this.parsed_url.hostname}\r\n` +
|
`Host: ${this.parsed_url.hostname}\r\n` +
|
||||||
this.sentHeaders +
|
this.sentHeaders +
|
||||||
`Connection: close\r\n` +
|
`Connection: close\r\n` +
|
||||||
`\r\n`
|
`\r\n`
|
||||||
|
|||||||
@ -151,9 +151,13 @@ function proxy_getter(req_url: string, req_proxy: ProxyOptions[], headers?: Obje
|
|||||||
password: parsed.password
|
password: parsed.password
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else opts = proxy;
|
} else
|
||||||
|
opts = {
|
||||||
|
host: proxy.host,
|
||||||
|
port: Number(proxy.port)
|
||||||
|
};
|
||||||
let req: ClientRequest;
|
let req: ClientRequest;
|
||||||
if (opts.authentication?.username.length === 0) {
|
if (!opts.authentication) {
|
||||||
req = http.request({
|
req = http.request({
|
||||||
host: opts.host,
|
host: opts.host,
|
||||||
port: opts.port,
|
port: opts.port,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user