xmpp-httpx - v0.11.0
    Preparing search index...

    Interface Socks5Adapter

    Node-only implementation lives behind this interface so the universal sipub code (src/sipub/sipub.ts) never imports node:net directly.

    interface Socks5Adapter {
        candidatesFor(
            sid: string,
            ctx: Socks5NegotiationContext,
        ): Promise<StreamhostCandidate[]>;
        connect(
            sid: string,
            candidates: readonly StreamhostCandidate[],
            ctx: Socks5NegotiationContext,
        ): Promise<Socks5ConnectResult>;
        openChosen(
            sid: string,
            usedJid: string,
            ctx: Socks5NegotiationContext & {
                activateJid?: string;
                candidates: readonly StreamhostCandidate[];
            },
        ): Promise<Socks5Duplex>;
        release(): void;
    }
    Index
    • Dial the peer's candidates in order; throws if all fail.

      Parameters

      Returns Promise<Socks5ConnectResult>

    • A candidate we offered was chosen: take up the connection. For a streamhost we host, that means the inbound socket the peer already opened; for a proxy, it means dialling it and sending the XEP-0065 <activate/>.

      activateJid names the peer to activate the stream to, when that is not ctx.targetJid — it differs by role in XEP-0260, while the two context JIDs must stay fixed because they are what the dstaddr hash is built from and both parties have to compute the same one.

      Parameters

      • sid: string
      • usedJid: string
      • ctx: Socks5NegotiationContext & {
            activateJid?: string;
            candidates: readonly StreamhostCandidate[];
        }

      Returns Promise<Socks5Duplex>