Socket
Socket
Sign inDemoInstall

@geckos.io/client

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geckos.io/client - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

14

lib/client.d.ts

@@ -1,2 +0,2 @@

import { RawMessage, Data, EventName, EventCallbackClient, ConnectionEventCallbackClient, EventCallbackRawMessage } from '@geckos.io/common/lib/typings';
import { RawMessage, Data, EventName, EventCallbackClient, ConnectionEventCallbackClient, EventCallbackRawMessage, ClientOptions } from '@geckos.io/common/lib/typings';
export declare class ClientChannel {

@@ -6,6 +6,6 @@ private peerConnection;

private url;
constructor(url: string, port: number, label: string);
constructor(url: string, port: number, label: string, rtcConfiguration: RTCConfiguration);
private onconnectionstatechange;
/** Get the channel's id. */
readonly id: string | undefined;
readonly id: import("@geckos.io/common/lib/typings").ChannelId;
/** Emit a message to the server. */

@@ -48,9 +48,7 @@ emit(eventName: EventName, data?: Data | null): void;

* @param options.label The label of the DataChannel. Default: 'geckos.io'.
* @param options.iceServers An array of RTCIceServers. See https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer.
* @param options.iceTransportPolicy RTCIceTransportPolicy enum defines string constants which can be used to limit the transport policies of the ICE candidates to be considered during the connection process.
*/
declare const geckosClient: (options?: {
url?: string | undefined;
port?: number | undefined;
label?: string | undefined;
}) => ClientChannel;
declare const geckosClient: (options?: ClientOptions) => ClientChannel;
export default geckosClient;
//# sourceMappingURL=client.d.ts.map

@@ -46,5 +46,5 @@ "use strict";

var ClientChannel = /** @class */ (function () {
function ClientChannel(url, port, label) {
function ClientChannel(url, port, label, rtcConfiguration) {
this.url = url + ":" + port;
this.connectionsManager = new connectionsManager_1.default(this.url, label);
this.connectionsManager = new connectionsManager_1.default(this.url, label, rtcConfiguration);
}

@@ -148,9 +148,11 @@ ClientChannel.prototype.onconnectionstatechange = function () {

* @param options.label The label of the DataChannel. Default: 'geckos.io'.
* @param options.iceServers An array of RTCIceServers. See https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer.
* @param options.iceTransportPolicy RTCIceTransportPolicy enum defines string constants which can be used to limit the transport policies of the ICE candidates to be considered during the connection process.
*/
var geckosClient = function (options) {
if (options === void 0) { options = {}; }
var _a = options.url, url = _a === void 0 ? location.protocol + "//" + location.hostname : _a, _b = options.port, port = _b === void 0 ? 9208 : _b, _c = options.label, label = _c === void 0 ? 'geckos.io' : _c;
return new ClientChannel(url, port, label);
var _a = options.iceServers, iceServers = _a === void 0 ? [] : _a, _b = options.iceTransportPolicy, iceTransportPolicy = _b === void 0 ? 'all' : _b, _c = options.url, url = _c === void 0 ? location.protocol + "//" + location.hostname : _c, _d = options.port, port = _d === void 0 ? 9208 : _d, _e = options.label, label = _e === void 0 ? 'geckos.io' : _e;
return new ClientChannel(url, port, label, { iceServers: iceServers, iceTransportPolicy: iceTransportPolicy });
};
exports.default = geckosClient;
//# sourceMappingURL=client.js.map

@@ -9,2 +9,3 @@ import { RawMessage, Data, ChannelId, EventName } from '@geckos.io/common/lib/typings';

label: string;
rtcConfiguration: RTCConfiguration;
localPeerConnection: RTCPeerConnection;

@@ -15,3 +16,3 @@ remotePeerConnection: RTCRemotePeerConnection;

emit(eventName: EventName, data?: Data | RawMessage | null): void;
constructor(url: string, label: string);
constructor(url: string, label: string, rtcConfiguration: RTCConfiguration);
onDataChannel: (ev: RTCDataChannelEvent) => void;

@@ -21,3 +22,3 @@ connect(): Promise<{

dataChannel: RTCDataChannel;
id: string | undefined;
id: ChannelId;
}>;

@@ -24,0 +25,0 @@ }

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -46,6 +57,7 @@ return new (P || (P = Promise))(function (resolve, reject) {

var ConnectionsManagerClient = /** @class */ (function () {
function ConnectionsManagerClient(url, label) {
function ConnectionsManagerClient(url, label, rtcConfiguration) {
var _this = this;
this.url = url;
this.label = label;
this.rtcConfiguration = rtcConfiguration;
this.onDataChannel = function (ev) {

@@ -96,3 +108,5 @@ var channel = ev.channel;

_b = this.remotePeerConnection, id = _b.id, localDescription = _b.localDescription;
configuration = {};
configuration = __assign({
// @ts-ignore
sdpSemantics: 'unified-plan' }, this.rtcConfiguration);
RTCPc = RTCPeerConnection ||

@@ -99,0 +113,0 @@ webkitRTCPeerConnection ||

{
"name": "@geckos.io/client",
"version": "1.1.0",
"version": "1.1.1",
"description": "Real-time client/server communication over UDP using WebRTC and Node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc