Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Jul 13, 2020
1 parent 823bf53 commit 06247a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/http_client.ts
Expand Up @@ -59,8 +59,10 @@ export async function exchange(request: Request): Promise<Response> {

async function connectProxy(url: URL, conn: Deno.Conn, reader: BufReader) {

const port = url.port ? url.port : url.protocol === "https:" ? 443 : 80;

const requestLine =
`CONNECT ${url.hostname}:${url.port} HTTP/1.1${DELIMITER}${DELIMITER}`;
`CONNECT ${url.hostname}:${port} HTTP/1.1${DELIMITER}${DELIMITER}`;

console.debug(requestLine);
await Deno.writeAll(conn, new TextEncoder().encode(requestLine));
Expand Down

0 comments on commit 06247a0

Please sign in to comment.