/// /// /// /// /// import churn_types = require('./churn.types'); import handler = require('../../../third_party/uproxy-lib/handler/queue'); import net = require('../net/net.types'); import peerconnection = require('../../../third_party/uproxy-lib/webrtc/peerconnection'); import ChurnSignallingMessage = churn_types.ChurnSignallingMessage; export declare var filterCandidatesFromSdp: (sdp: string) => string; export declare var extractEndpointFromCandidateLine: (candidate: string) => net.Endpoint; export declare var setCandidateLineEndpoint: (candidate: string, endpoint: net.Endpoint) => string; export interface NatPair { internal: net.Endpoint; external: net.Endpoint; } export declare var selectPublicAddress: (candidates: freedom_RTCPeerConnection.RTCIceCandidate[]) => NatPair; /** * A uproxypeerconnection-like Freedom module which establishes obfuscated * connections. * * DTLS packets are intercepted by pointing WebRTC at a local "forwarding" * port; connectivity to the remote host is achieved with the help of * another preceding, short-lived, peer-to-peer connection. * * This is mostly a thin wrapper over uproxypeerconnection except for the * magic required during setup. * * TODO: Give the uproxypeerconnections name, to help debugging. * TODO: Allow obfuscation parameters be configured. */ export declare class Connection implements peerconnection.PeerConnection { pcState: peerconnection.State; dataChannels: { [channelLabel: string]: peerconnection.DataChannel; }; peerOpenedChannelQueue: handler.QueueHandler; signalForPeerQueue: handler.Queue; peerName: string; onceConnecting: Promise; onceConnected: Promise; onceDisconnected: Promise; private probeConnection_; private probeCandidates_; private probingComplete_; private onceProbingComplete_; private obfuscatedConnection_; private haveWebRtcEndpoint_; private onceHaveWebRtcEndpoint_; private haveRemoteEndpoint_; private onceHaveRemoteEndpoint_; private haveForwardingSocketEndpoint_; private onceHaveForwardingSocketEndpoint_; private mirrorPipes_; private static internalConnectionId_; constructor(probeRtcPc: freedom_RTCPeerConnection.RTCPeerConnection, peerName?: string); private configureProbeConnection_; private addLocalPipe_; private bindPublicPipe_; private configurePipes_; private configureObfuscatedConnection_; negotiateConnection: () => Promise; handleSignalMessage: (churnMessage: churn_types.ChurnSignallingMessage) => void; openDataChannel: (channelLabel: string, options?: freedom_RTCPeerConnection.RTCDataChannelInit) => Promise; close: () => Promise; toString: () => string; }