Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-cronin committed Oct 22, 2020
1 parent 7bb0efa commit 356748a
Show file tree
Hide file tree
Showing 10 changed files with 395 additions and 471 deletions.
9 changes: 4 additions & 5 deletions proto/Peer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ message HolePunchConnectionMessage {
//////////////////////
// Relay Connection //
//////////////////////
message RelayConnectionRequest {
string peer_id = 1;
}
message RelayConnectionResponse {
string relay_address = 1;
message RelayConnectionMessage {
string target_peer_id = 1;
string origin_peer_id = 2;
string relay_address = 3;
}

//////////////////////
Expand Down
116 changes: 33 additions & 83 deletions proto/js/Peer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,128 +699,78 @@ declare namespace Peer {
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): peerInterface.HolePunchConnectionMessage;
}

/** Properties of a RelayConnectionRequest. */
interface IRelayConnectionRequest {
/** Properties of a RelayConnectionMessage. */
interface IRelayConnectionMessage {

/** RelayConnectionRequest peerId */
peerId?: (string|null);
}

/** Represents a RelayConnectionRequest. */
class RelayConnectionRequest implements IRelayConnectionRequest {

/**
* Constructs a new RelayConnectionRequest.
* @param [p] Properties to set
*/
constructor(p?: peerInterface.IRelayConnectionRequest);

/** RelayConnectionRequest peerId. */
public peerId: string;

/**
* Creates a new RelayConnectionRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns RelayConnectionRequest instance
*/
public static create(properties?: peerInterface.IRelayConnectionRequest): peerInterface.RelayConnectionRequest;

/**
* Encodes the specified RelayConnectionRequest message. Does not implicitly {@link peerInterface.RelayConnectionRequest.verify|verify} messages.
* @param m RelayConnectionRequest message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: peerInterface.IRelayConnectionRequest, w?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified RelayConnectionRequest message, length delimited. Does not implicitly {@link peerInterface.RelayConnectionRequest.verify|verify} messages.
* @param message RelayConnectionRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: peerInterface.IRelayConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a RelayConnectionRequest message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns RelayConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): peerInterface.RelayConnectionRequest;

/**
* Decodes a RelayConnectionRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns RelayConnectionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): peerInterface.RelayConnectionRequest;
}
/** RelayConnectionMessage targetPeerId */
targetPeerId?: (string|null);

/** Properties of a RelayConnectionResponse. */
interface IRelayConnectionResponse {
/** RelayConnectionMessage originPeerId */
originPeerId?: (string|null);

/** RelayConnectionResponse relayAddress */
/** RelayConnectionMessage relayAddress */
relayAddress?: (string|null);
}

/** Represents a RelayConnectionResponse. */
class RelayConnectionResponse implements IRelayConnectionResponse {
/** Represents a RelayConnectionMessage. */
class RelayConnectionMessage implements IRelayConnectionMessage {

/**
* Constructs a new RelayConnectionResponse.
* Constructs a new RelayConnectionMessage.
* @param [p] Properties to set
*/
constructor(p?: peerInterface.IRelayConnectionResponse);
constructor(p?: peerInterface.IRelayConnectionMessage);

/** RelayConnectionMessage targetPeerId. */
public targetPeerId: string;

/** RelayConnectionMessage originPeerId. */
public originPeerId: string;

/** RelayConnectionResponse relayAddress. */
/** RelayConnectionMessage relayAddress. */
public relayAddress: string;

/**
* Creates a new RelayConnectionResponse instance using the specified properties.
* Creates a new RelayConnectionMessage instance using the specified properties.
* @param [properties] Properties to set
* @returns RelayConnectionResponse instance
* @returns RelayConnectionMessage instance
*/
public static create(properties?: peerInterface.IRelayConnectionResponse): peerInterface.RelayConnectionResponse;
public static create(properties?: peerInterface.IRelayConnectionMessage): peerInterface.RelayConnectionMessage;

/**
* Encodes the specified RelayConnectionResponse message. Does not implicitly {@link peerInterface.RelayConnectionResponse.verify|verify} messages.
* @param m RelayConnectionResponse message or plain object to encode
* Encodes the specified RelayConnectionMessage message. Does not implicitly {@link peerInterface.RelayConnectionMessage.verify|verify} messages.
* @param m RelayConnectionMessage message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: peerInterface.IRelayConnectionResponse, w?: $protobuf.Writer): $protobuf.Writer;
public static encode(m: peerInterface.IRelayConnectionMessage, w?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified RelayConnectionResponse message, length delimited. Does not implicitly {@link peerInterface.RelayConnectionResponse.verify|verify} messages.
* @param message RelayConnectionResponse message or plain object to encode
* Encodes the specified RelayConnectionMessage message, length delimited. Does not implicitly {@link peerInterface.RelayConnectionMessage.verify|verify} messages.
* @param message RelayConnectionMessage message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: peerInterface.IRelayConnectionResponse, writer?: $protobuf.Writer): $protobuf.Writer;
public static encodeDelimited(message: peerInterface.IRelayConnectionMessage, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a RelayConnectionResponse message from the specified reader or buffer.
* Decodes a RelayConnectionMessage message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns RelayConnectionResponse
* @returns RelayConnectionMessage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): peerInterface.RelayConnectionResponse;
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): peerInterface.RelayConnectionMessage;

/**
* Decodes a RelayConnectionResponse message from the specified reader or buffer, length delimited.
* Decodes a RelayConnectionMessage message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns RelayConnectionResponse
* @returns RelayConnectionMessage
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): peerInterface.RelayConnectionResponse;
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): peerInterface.RelayConnectionMessage;
}

/** CAMessageType enum. */
Expand Down
Loading

0 comments on commit 356748a

Please sign in to comment.