Comments (9)
能详细说说吗?没懂这个意思
from websocket-heartbeat-js.
构造函数
WebSocket(url[, protocols])
返回一个 WebSocket 对象。里面protocols这个参数
from websocket-heartbeat-js.
实例化之后,会有个ws属性文档中有说明,ws就是原生的websocket实例,ws.protocol 就可以拿到协议。
let websocketHeartbeatJs = new WebsocketHeartbeatJs({ url: 'ws://xxxxxxx' }); websocketHeartbeatJs.ws
from websocket-heartbeat-js.
WebsocketHeartbeatJs的pingMsg使用string无法传protocal,websocket-heartbeat-miniprogram是js写的没有限制可以用
from websocket-heartbeat-js.
WebsocketHeartbeatJs的pingMsg使用string无法传protocal,websocket-heartbeat-miniprogram是js写的没有限制可以用
额,之前写死了,没有支持传入这个参数,我近期更新一下。上次这老哥问过,当时可能理解错了,唉,sorry
from websocket-heartbeat-js.
@JakeWoki 我现在把WebSocket构造函数的protocols参数定义了,然后把d.ts文件的pingMsg类型设置为any,这样应该可以支持你的需求了吧?
from websocket-heartbeat-js.
可以的 多谢
from websocket-heartbeat-js.
@JakeWoki 1.1.0版本发布了 试下呢
from websocket-heartbeat-js.
可以了
from websocket-heartbeat-js.
Related Issues (20)
- 一直在重连 HOT 2
- 大佬你这个封装好的webscoket我一个页面会运行多个实例。这个没问题吧? HOT 1
- 作者你好,我这有个问题。 HOT 9
- 博主你好,我想问下你这个连接操作 HOT 25
- 【BUG】重连逻辑存在漏洞
- [Feature] Will add a filter abuot Pong messages for “onmessage” function HOT 4
- Throws error when bundled in code that also runs on node.js HOT 6
- WebSocket is not a constructor HOT 5
- 能不能实现单例连接呢? HOT 4
- repeatLimit设置次数为0, 依然会无限连接 HOT 4
- close能不能返回事件,至少要看到为什么close吧 HOT 5
- pingMsg能否支持函数? HOT 3
- vue3+ts环境 , 使用demo里的代码钩子函数不执行 HOT 1
- why client reconnect to server periodically HOT 1
- 可否加个重连次数的限制? HOT 2
- WebSocket 应用逻辑 HOT 4
- 我想重联时给url增加参数如何实现 HOT 8
- repeatLimit无效,无论设置多少都是无限重连 HOT 1
- 问下为什么把返回的对象存进vuex里面的属性。然后调用关闭方法 没效果? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websocket-heartbeat-js.