@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in
23 lines (22 loc) • 1.27 kB
TypeScript
import type { INetworkingWebsocketUrlProvider } from "../engine/engine_networking.js";
import { Behaviour } from "./Component.js";
/**
* The networking component is used to provide a websocket url to the networking system. It implements the {@link INetworkingWebsocketUrlProvider} interface.
* @category Networking
* @group Components
*/
export declare class Networking extends Behaviour implements INetworkingWebsocketUrlProvider {
/** The url that should be used for the websocket connection */
url: string | null;
/** The name of the url parameter that should be used to override the url. When set the url will be overridden by the url parameter e.g. when `urlParameterName=ws` `?ws=ws://localhost:8080` */
urlParameterName: string | null;
/** Thie localhost url that should be used when the networking is running on a local network. This is useful when the server is running on the same machine as the client.
*/
localhost: string | null;
/** @internal */
awake(): void;
/** @internal */
getWebsocketUrl(): string | null;
static GetUrl(url: string | null | undefined, localhostFallback?: string | null): string | null | undefined;
static IsLocalNetwork(hostname?: string): boolean;
}