chore: Adding mainFn helpers

This commit is contained in:
BluJ
2023-04-07 11:43:05 -06:00
parent 74e765511e
commit 49277bfc78
35 changed files with 457 additions and 183 deletions

14
lib/mainFn/TorHostname.ts Normal file
View File

@@ -0,0 +1,14 @@
import { Effects } from "../types";
import { TorBinding } from "./TorBinding";
export class TorHostname {
constructor(readonly id: string, readonly effects: Effects) {}
async bindTor(internalPort: number, externalPort: number) {
const address = await this.effects.bindTor({
internalPort,
name: this.id,
externalPort,
});
return new TorBinding(address);
}
}