Skip to content
forked from sy-records/wstool

Blob WebSocket在线测试工具

Notifications You must be signed in to change notification settings

karp90000/wstool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

基于fork 的项目 修改了 onmessage 将接收的 blob 格式转换为可识别的字符串

  wsInstance.onmessage = function (ev) {
        console.warn(ev)
        if (!_this.recvPause) {
            let data = ev.data
            if (_this.recvClean) _this.messageData = [];

            let reader = new FileReader();
            reader.readAsArrayBuffer(data,'utf-8');
            reader.onload = function(){
                console.log("blob转arrayBuffer", reader.result);
                let inflatedData = pako.inflate(reader.result, {
                    to:"string"
                })

                _this.writeNews(0, inflatedData);
            }

        }
    }

About

Blob WebSocket在线测试工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.7%
  • HTML 4.3%