Class: WebSocketDevClientServer

Class for creating a WebSocket server for communication with React Native clients. All client logs - logs from React Native application - are processed here.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WebSocketDevClientServer(fastify)

Create new instance of WebSocketDevClientServer and attach it to the given Fastify instance. Any logging information, will be passed through standard fastify.log API.

Parameters

Name Type Description
fastify FastifyDevServer Fastify instance to attach the WebSocket server to.

Overrides

WebSocketServer.constructor

Defined in

packages/repack/src/server/ws/WebSocketDevClientServer.ts:21

Properties

fastify

Protected fastify: FastifyDevServer

Fastify instance from which server will receive upgrade connections.

Inherited from

WebSocketServer.fastify

Defined in

packages/repack/src/server/ws/WebSocketServer.ts:16


paths

Readonly paths: string[]

Inherited from

WebSocketServer.paths

Defined in

packages/repack/src/server/ws/WebSocketServer.ts:18


server

Readonly server: Server

An instance of the underlying WebSocket server.

Inherited from

WebSocketServer.server

Defined in

packages/repack/src/server/ws/WebSocketServer.ts:13

Methods

onConnection

onConnection(socket): void

Process new WebSocket connection from client application.

Parameters

Name Type Description
socket WebSocket Incoming client's WebSocket connection.

Returns

void

Overrides

WebSocketServer.onConnection

Defined in

packages/repack/src/server/ws/WebSocketDevClientServer.ts:52


processMessage

processMessage(message): void

Process client message.

Parameters

Name Type Description
message string Stringified client message.

Returns

void

Defined in

packages/repack/src/server/ws/WebSocketDevClientServer.ts:30


shouldUpgrade

shouldUpgrade(pathname): boolean

Parameters

Name Type
pathname string

Returns

boolean

Inherited from

WebSocketServer.shouldUpgrade

Defined in

packages/repack/src/server/ws/WebSocketServer.ts:45


upgrade

upgrade(request, socket, head): void

Parameters

Name Type
request IncomingMessage
socket Socket
head Buffer

Returns

void

Inherited from

WebSocketServer.upgrade

Defined in

packages/repack/src/server/ws/WebSocketServer.ts:49