mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-04 14:29:47 +00:00
chore: Adding mainFn helpers
This commit is contained in:
14
lib/mainFn/TorHostname.ts
Normal file
14
lib/mainFn/TorHostname.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user