Skip to content

Commit

Permalink
fix: #24 follow up (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Nov 17, 2022
1 parent 02cae58 commit 03c1399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export {
export { Buffer } from "https://deno.land/std@0.164.0/node/buffer.ts";

// x/
export { SocksClient } from "https://deno.land/x/deno_socks@v2.6.1/mod.ts";
export { getWords } from "https://deno.land/x/dryptography@v0.1.4/aes/utils/words.ts";

// cdn.skypack.dev/
Expand All @@ -36,16 +35,17 @@ export {
Parser,
} from "https://ghc.deno.dev/tbjgolden/deno-htmlparser2@1f76cdf/htmlparser2/Parser.ts";

import { type Socket as Socket_ } from "https://deno.land/std@0.164.0/node/net.ts";
export { type Socket } from "https://deno.land/std@0.164.0/node/net.ts";

let Socket: typeof Socket_ = null as unknown as typeof Socket_;
import { type SocksClient as SocksClient_ } from "https://deno.land/x/deno_socks@v2.6.1/mod.ts";

export let SocksClient = null as unknown as typeof SocksClient_;

if (typeof document === "undefined") {
Socket = (await import("https://deno.land/std@0.164.0/node/net.ts")).Socket;
SocksClient =
(await import("https://deno.land/x/deno_socks@v2.6.1/mod.ts")).SocksClient;
}

export { Socket, Socket_ };

export class WriteStream {
constructor(public path: string, public file: Deno.FsFile) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/promised_net_sockets.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// deno-lint-ignore-file no-explicit-any
import { Buffer, Mutex, Socket, Socket_, SocksClient } from "../../deps.ts";
import { Buffer, Mutex, Socket, SocksClient } from "../../deps.ts";
import { ProxyInterface } from "../network/connection/types.ts";

const mutex = new Mutex();
const closeError = new Error("NetSocket was closed");

export class PromisedNetSockets {
private client?: Socket_;
private client?: Socket;
private closed: boolean;
private stream: Buffer;
private canRead?: boolean | Promise<boolean>;
Expand Down

0 comments on commit 03c1399

Please sign in to comment.