Skip to main content
Version: 2x

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

NameTypeDescription
fastifyFastifyDevServerFastify 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

NameTypeDescription
socketWebSocketIncoming 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

NameTypeDescription
messagestringStringified client message.

Returns

void

Defined in

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


shouldUpgrade

shouldUpgrade(pathname): boolean

Parameters

NameType
pathnamestring

Returns

boolean

Inherited from

WebSocketServer.shouldUpgrade

Defined in

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


upgrade

upgrade(request, socket, head): void

Parameters

NameType
requestIncomingMessage
socketSocket
headBuffer

Returns

void

Inherited from

WebSocketServer.upgrade

Defined in

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