Websocket

Constructor

  • Constructor params:

    • url : string Connection url Default: 'ws://localhost:31420'
    • timeout : number Timeout(ms) Default: 60000
    • Object
  • Example:


import wsProvider from "@vite/vitejs/dist/es5/provider/WS";
const myWs = new wsProvider("ws://localhost:8080");

WS Provider

Instance Properties

Name Type Description
url string Network connection path
protocol string Protocol
headers object Request header information
clientConfig object Same as Above

Instance Methods

Except for the public methods of provider instance

Reconnect

Network reconnection