Coder Social home page Coder Social logo

protocal传参 about websocket-heartbeat-js HOT 9 CLOSED

zimv avatar zimv commented on June 30, 2024
protocal传参

from websocket-heartbeat-js.

Comments (9)

zimv avatar zimv commented on June 30, 2024

能详细说说吗?没懂这个意思

from websocket-heartbeat-js.

lkdghzh avatar lkdghzh commented on June 30, 2024

构造函数
WebSocket(url[, protocols])
返回一个 WebSocket 对象。里面protocols这个参数

from websocket-heartbeat-js.

zimv avatar zimv commented on June 30, 2024

实例化之后,会有个ws属性文档中有说明,ws就是原生的websocket实例,ws.protocol 就可以拿到协议。
let websocketHeartbeatJs = new WebsocketHeartbeatJs({ url: 'ws://xxxxxxx' }); websocketHeartbeatJs.ws

from websocket-heartbeat-js.

JakeWoki avatar JakeWoki commented on June 30, 2024

WebsocketHeartbeatJs的pingMsg使用string无法传protocal,websocket-heartbeat-miniprogram是js写的没有限制可以用

from websocket-heartbeat-js.

zimv avatar zimv commented on June 30, 2024

WebsocketHeartbeatJs的pingMsg使用string无法传protocal,websocket-heartbeat-miniprogram是js写的没有限制可以用

额,之前写死了,没有支持传入这个参数,我近期更新一下。上次这老哥问过,当时可能理解错了,唉,sorry

from websocket-heartbeat-js.

zimv avatar zimv commented on June 30, 2024

@JakeWoki 我现在把WebSocket构造函数的protocols参数定义了,然后把d.ts文件的pingMsg类型设置为any,这样应该可以支持你的需求了吧?

from websocket-heartbeat-js.

JakeWoki avatar JakeWoki commented on June 30, 2024

可以的 多谢

from websocket-heartbeat-js.

zimv avatar zimv commented on June 30, 2024

@JakeWoki 1.1.0版本发布了 试下呢

from websocket-heartbeat-js.

JakeWoki avatar JakeWoki commented on June 30, 2024

可以了

from websocket-heartbeat-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.