Identity of a conode

### Hierarchy

- Message<ServerIdentity>
  - ServerIdentity

## Index

### Constructors

- constructor

### Properties

- $type
- _point
- address
- description
- id
- public
- serviceIdentities
- url
- $type

### Methods

- getPublic
- getWebSocketAddress
- toJSON
- addressToWebsocket
- create
- decode
- decodeDelimited
- encode
- encodeDelimited
- fromObject
- isValidAddress
- register
- toObject
- urlToWebsocket
- verify

## Constructors

### constructor

- new ServerIdentity(properties?: Properties<ServerIdentity>): ServerIdentity

- Overrides Message.__constructor

  - Defined in src/network/proto.ts:244

  #### Parameters

  - ##### Optional properties: Properties<ServerIdentity>

  #### Returns ServerIdentity

## Properties

### $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:524

Reference to the reflected type.

### Private _point

_point: Point

- Defined in src/network/proto.ts:244

### address

address: string

- Defined in src/network/proto.ts:240

### description

description: string

- Defined in src/network/proto.ts:241

### id

id: Buffer

- Defined in src/network/proto.ts:239

### public

public: Buffer

- Defined in src/network/proto.ts:238

### serviceIdentities

serviceIdentities: ServiceIdentity[]

- Defined in src/network/proto.ts:242

### url

url: string

- Defined in src/network/proto.ts:243

### Static $type

$type: Type

Inherited from Message.$type

- Defined in node_modules/protobufjs/index.d.ts:521

Reference to the reflected type.

## Methods

### getPublic

- getPublic(): Point

- - Defined in src/network/proto.ts:263

  Get the public key of the server as a Point

  #### Returns Point

  the point

### getWebSocketAddress

- getWebSocketAddress(): string

- - Defined in src/network/proto.ts:277

  Returns websocket version of this.url if set, otherwise converts the server address to match the websocket format.

  #### Returns string

  the websocket address

### toJSON

- toJSON(): object

- Inherited from Message.toJSON

  - Defined in node_modules/protobufjs/index.d.ts:589

  Converts this message to JSON.

  #### Returns object

  JSON object

  - ##### [k: string]: any

### Static addressToWebsocket

- addressToWebsocket(address: string, path?: string): string

- - Defined in src/network/proto.ts:232

  Converts a TLS URL to a Wesocket URL and builds a complete URL with the path given as parameter.

  #### Parameters

  - ##### address: string

    the server identity to take the urlRegistered from

  - ##### Default value path: string = ""

    the path after the base urlRegistered

  #### Returns string

  a websocket address

### Static create

- create<T>(this: Constructor<T>, properties?: object): Message<T>

- Inherited from Message.create

  - Defined in node_modules/protobufjs/index.d.ts:531

  Creates a new message of this type using the specified properties.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### Optional properties: object

    - ##### [k: string]: any

  #### Returns Message<T>

  Message instance

### Static decode

- decode<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decode

  - Defined in node_modules/protobufjs/index.d.ts:554

  Decodes a message of this type.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static decodeDelimited

- decodeDelimited<T>(this: Constructor<T>, reader: Reader | Uint8Array): T

- Inherited from Message.decodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:561

  Decodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### reader: Reader | Uint8Array

    Reader or buffer to decode

  #### Returns T

  Decoded message

### Static encode

- encode<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encode

  - Defined in node_modules/protobufjs/index.d.ts:539

  Encodes a message of this type.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static encodeDelimited

- encodeDelimited<T>(this: Constructor<T>, message: T | object, writer?: Writer): Writer

- Inherited from Message.encodeDelimited

  - Defined in node_modules/protobufjs/index.d.ts:547

  Encodes a message of this type preceeded by its length as a varint.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T | object

    Message to encode

  - ##### Optional writer: Writer

  #### Returns Writer

  Writer

### Static fromObject

- fromObject<T>(this: Constructor<T>, object: object): T

- Inherited from Message.fromObject

  - Defined in node_modules/protobufjs/index.d.ts:575

  Creates a new message of this type from a plain object. Also converts values to their respective internal types.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### object: object

    Plain object

    - ##### [k: string]: any

  #### Returns T

  Message instance

### Static isValidAddress

- isValidAddress(address: string): boolean

- - Defined in src/network/proto.ts:211

  Checks wether the address given as parameter has the right format.

  #### Parameters

  - ##### address: string

    the address to check

  #### Returns boolean

  true if and only if the address has the right format

### Static register

- register(): void

- - Defined in src/network/proto.ts:202
  see

    README#Message classes

  #### Returns void

### Static toObject

- toObject<T>(this: Constructor<T>, message: T, options?: IConversionOptions): object

- Inherited from Message.toObject

  - Defined in node_modules/protobufjs/index.d.ts:583

  Creates a plain object from a message of this type. Also converts values to other types if specified.

  #### Type parameters

  - #### T: Message<ServerIdentity>

  #### Parameters

  - ##### this: Constructor<T>

  - ##### message: T

    Message instance

  - ##### Optional options: IConversionOptions

  #### Returns object

  Plain object

  - ##### [k: string]: any

### Static urlToWebsocket

- urlToWebsocket(url: string): string

- - Defined in src/network/proto.ts:192

  Converts an HTTP-S URL to a Wesocket URL. It converts 'http' to 'ws' and 'https' to 'wss'. Any other protocols are forbidden and will raise an error. It also removes any trailing '/'. Here are some examples: http://example.com:77 => ws://example.com:77 https://example.com/path/ => wss:example.com/path https://example.com:443/ => wss:example.com tcp://127.0.0.1 => Error Note: It will NOT include the given port in the case it's the default one (for example 80 or 443). Note: In the case there are many slashes at the end of the url, it will only remove one.

  #### Parameters

  - ##### url: string

    the given url field

  #### Returns string

  a websocket url

### Static verify

- verify(message: object): string

- Inherited from Message.verify

  - Defined in node_modules/protobufjs/index.d.ts:568

  Verifies a message of this type.

  #### Parameters

  - ##### message: object

    Plain object to verify

    - ##### [k: string]: any

  #### Returns string

  `null` if valid, otherwise the reason why it is not

Generated using TypeDoc