Socket
Socket
Sign inDemoInstall

@types/sockjs

Package Overview
Dependencies
2
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/sockjs

TypeScript definitions for sockjs


Version published
Weekly downloads
8.7M
increased by3.91%
Maintainers
1
Install size
2.00 MB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/sockjs

Summary

This package contains type definitions for sockjs (https://github.com/sockjs/sockjs-node).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sockjs.

index.d.ts

/// <reference types="node" />

import http = require("http");

export interface ServerOptions {
    sockjs_url?: string | undefined;
    prefix?: string | undefined;
    response_limit?: number | undefined;
    websocket?: boolean | undefined;
    jsessionid?: any;
    log?(severity: string, message: string): void;
    heartbeat_delay?: number | undefined;
    disconnect_delay?: number | undefined;
}

export function createServer(options?: ServerOptions): Server;

export interface Server extends NodeJS.EventEmitter {
    installHandlers(server: http.Server, options?: ServerOptions): any;

    on(event: "connection", listener: (conn: Connection) => any): this;
    on(event: string, listener: Function): this;
}

export interface Connection extends NodeJS.ReadWriteStream {
    remoteAddress: string;
    remotePort: number;
    address: {
        [key: string]: {
            address: string;
            port: number;
        };
    };
    headers: {
        [key: string]: string;
    };
    url: string;
    pathname: string;
    prefix: string;
    protocol: string;
    readyState: number;
    id: string;

    close(code?: string, reason?: string): boolean;
    destroy(): void;

    on(event: "data", listener: (message: string) => any): this;
    on(event: "close", listener: () => void): this;
    on(event: string, listener: Function): this;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Phil McCloghry-Laing.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc