Socket
Book a DemoInstallSign in
Socket

nengi-geckos-client-adapter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nengi-geckos-client-adapter

geckos.io client network adapter for nengi v2

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

geckos.io client network adapter for nengi v2

Warning This adapter is written and tested only on nengi v2.0.0-alpha.133, this is an unstable version, the api of which may change in the future

Install

npm i nengi-geckos-client-adapter

Usage

Client-side

import { Client, Context } from "nengi";
import { GeckosClientAdapter } from "nengi-geckos-client-adapter";

const serverTickRate = 20;
const ctx = new Context();
// <...>
const client = new Client(ctx, GeckosClientAdapter, serverTickRate);

await client.connect("http://localhost:9001");

Or if you want to pass additional options to the geckos.io client use an alternative connection method:

const geckosOptions = {};
await(client.adapter as GeckosClientAdapter).connect(
  "http://localhost:9001",
  {}, // handshake
  geckosOptions
);

All available client options is described here https://github.com/geckosio/geckos.io#client-1

Server-side

For server-side you need nengi-geckos-server-adapter

Keywords

nengi

FAQs

Package last updated on 01 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts