Chrome浏览器 - 禁用Web套接字或关闭Web套接字连接? [英] Chrome - Disabling Web Sockets or Closing a Web Socket Connection?

查看:207
本文介绍了Chrome浏览器 - 禁用Web套接字或关闭Web套接字连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以禁用web套接字连接或通过Chrome的开发人员工具网络选项卡终止web套接字连接?



我注意到网络下的节流标签到 Offline 不会影响已建立的网络套接字连接。它只能防止传统的HTTP请求外出。



有一个问题



您必须使用 WebSockets API 并调用< a href =https://developer.mozilla.org/en-US/docs/Web/API/WebSocket#close() =noreferrer> close() 对现有套接字的引用来明确地关闭它。否则,使用活动套接字终止进程是我能想到的。


Is there any way to disable web socket connections or end a web socket connection through Chrome's developer tools network tab?

I've noticed that turning throttling under the network tab to Offline doesn't affect web socket connections that have already been established. It only prevents traditional HTTP requests from going out.

There's a question here related to this, but it's woefully outdated.

解决方案

You can close idle and flush your inactive socket pools in the Net Internals page in Chrome. However, this unfortunately only closes your active sockets by the looks of it.

chrome://net-internals/#sockets

You would have to use the WebSockets API and call close() on a reference to an existing socket to close it explicitly. Otherwise, killing the process with the active socket is all I can think of.

这篇关于Chrome浏览器 - 禁用Web套接字或关闭Web套接字连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆