🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More
Socket
Sign inDemoInstall
Socket

@hediet/typed-json-rpc-websocket-server

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hediet/typed-json-rpc-websocket-server - npm Package Compare versions

Comparing version

to
0.3.13

3

dist/index.d.ts
import WebSocket = require("ws");
import { TypedChannel, RpcLogger } from "@hediet/typed-json-rpc";
import { WebSocketStream } from "@hediet/typed-json-rpc-websocket";

@@ -7,3 +6,3 @@ import { EventSource } from "@hediet/std/events";

port?: number;
}, logger: RpcLogger | undefined, handleConnection: (channel: TypedChannel, stream: WebSocketStream) => void): WebSocketServer;
}, handleConnection: (stream: WebSocketStream) => void): WebSocketServer;
export declare class WebSocketServer {

@@ -10,0 +9,0 @@ private readonly server;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebSocket = require("ws");
const typed_json_rpc_1 = require("@hediet/typed-json-rpc");
const typed_json_rpc_websocket_1 = require("@hediet/typed-json-rpc-websocket");
const events_1 = require("@hediet/std/events");
const synchronization_1 = require("@hediet/std/synchronization");
function startWebSocketServer(options, logger, handleConnection) {
function startWebSocketServer(options, handleConnection) {
let opts = {};

@@ -16,4 +15,3 @@ if (options.port) {

const stream = new typed_json_rpc_websocket_1.WebSocketStream(ws);
const channelFactory = typed_json_rpc_1.StreamBasedChannel.getFactory(stream, logger);
handleConnection(new typed_json_rpc_1.TypedChannel(channelFactory, logger), stream);
handleConnection(stream);
});

@@ -20,0 +18,0 @@ return new WebSocketServer(wss);

{
"name": "@hediet/typed-json-rpc-websocket-server",
"version": "0.3.12",
"version": "0.3.13",
"author": {

@@ -5,0 +5,0 @@ "name": "Henning Dieterichs"

import WebSocket = require("ws");
import {
TypedChannel,
StreamBasedChannel,
RpcLogger,
} from "@hediet/typed-json-rpc";
import { WebSocketStream } from "@hediet/typed-json-rpc-websocket";

@@ -13,4 +8,3 @@ import { EventEmitter, EventSource } from "@hediet/std/events";

options: { port?: number },
logger: RpcLogger | undefined,
handleConnection: (channel: TypedChannel, stream: WebSocketStream) => void
handleConnection: (stream: WebSocketStream) => void
): WebSocketServer {

@@ -25,4 +19,3 @@ let opts: WebSocket.ServerOptions = {};

const stream = new WebSocketStream(ws);
const channelFactory = StreamBasedChannel.getFactory(stream, logger);
handleConnection(new TypedChannel(channelFactory, logger), stream);
handleConnection(stream);
});

@@ -29,0 +22,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet