/// /// import candidate = require('./candidate'); import churn_types = require('./churn.types'); import handler = require('../handler/queue'); import net = require('../net/net.types'); import peerconnection = require('../webrtc/peerconnection'); import ChurnSignallingMessage = churn_types.ChurnSignallingMessage; import TransformerConfig = churn_types.TransformerConfig; export declare var filterCandidatesFromSdp: (sdp: string) => string; export declare var getMidFromSdp: (sdp: string) => string; export interface NatPair { internal: net.Endpoint; external: net.Endpoint; } export declare var selectBestPublicAddress: (candidates: candidate.Candidate[]) => NatPair; /** * A PeerConnection implementation that 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 * the browser's STUN implementation. * * This is mostly a thin wrapper over PeerConnection except for the * magic required during setup. * * Right now, CaesarCipher is used with a key which is randomly generated * each time a new connection is negotiated. */ export declare class Connection implements peerconnection.PeerConnection { private name_; private skipPublicEndpoint_; private portControl_; private preferredTransformerConfig_; private static id_; private mid_; private static PROBE_TIMEOUT_MS_; peerOpenedChannelQueue: handler.QueueHandler; signalForPeerQueue: handler.Queue; private candidateQueue_; onceConnected: Promise; onceClosed: Promise; private probeConnection_; private obfuscatedConnection_; private remoteCandidates_; private haveTransformerConfig_; private onceHaveTransformerConfig_; private pipe_; private havePipe_; private onceHavePipe_; private probingComplete_; private onceProbingComplete_; private static internalConnectionId_; constructor(probeRtcPc: freedom.RTCPeerConnection.RTCPeerConnection, name_?: string, skipPublicEndpoint_?: boolean, portControl_?: freedom.PortControl.PortControl, preferredTransformerConfig_?: TransformerConfig); private configureProbeConnection_; private candidateQueueHandler_; private processProbeCandidates_; private configurePipe_; private addRemoteCandidate_; private getRemoteCandidate_; private onMappingAdded_; private configureObfuscatedConnection_; negotiateConnection: () => Promise; private static rtcIceCandidateFromPublicEndpoint_; handleSignalMessage: (churnMessage: churn_types.ChurnSignallingMessage) => void; openDataChannel: (channelLabel: string, options?: freedom.RTCPeerConnection.RTCDataChannelInit) => Promise; close: () => Promise; toString: () => string; }