Skip to content

Websocket .ping and .onpong missing #14855

@msageryd

Description

@msageryd

Websocket in RN seems to to respond correctly with a pong when ping is received (as per the Websockets spec.).

It would be great if there also where a function to send a ping and an event for knowing when pong is received.

Like this:

var ws = new WebSocket('ws://host.com/path');

ws.ping();

ws.onpong = () => {
  // pong received  
  // this socket is alive
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions