在Firefox或我的代理中禁用websocket [英] disabling websocket in Firefox or in my proxy

查看:336
本文介绍了在Firefox或我的代理中禁用websocket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Firefox配置为将我的代理用于http和https.是的,我自己编写了代理的代码,因此可以完全控制那里.

I have configured Firefox to use a proxy of mine for http and https. Yes, I write the code for the proxy myself so I'm in complete control there.

您可能已经知道,无法再通过about:config在Firefox中禁用WebSocket.我正在寻找一种禁用它的轻量级方法.如果在Firefox中根本不可能,则必须在代理中执行某些操作.

As you may know it's no longer possible to disable WebSocket in Firefox through about:config. I'm looking for a lightweight way of disabling it. If it's not possible at all in Firefox I've got to do something in my proxy.

这是我的问题:将Firefox配置为使用http代理时,是否总是向代理发送HTTP CONNECT请求以建立WebSocket连接?如果我的代理返回不允许的HTTP/1.1 405方法怎么办?这足以说服Firefox放弃WebSocket吗?这样的响应后,Firefox是否有可能绕过WebSocket问题中的我的代理?毕竟,我还没有将其配置为将代理用于ws或wss协议.并且在Firefox中未禁用ws/wss.

Here's my question: When Firefox is configured to use an http proxy, does it ALWAYS send an http CONNECT request to the proxy to establish the WebSocket connection? What happens if my proxy returns HTTP/1.1 405 Method Not Allowed? Is that enough to convince Firefox to abandon WebSocket? Is there any chance that Firefox might bypass my proxy in WebSocket matters after such a response? After all, I haven't configured it to use my proxy for the ws or wss protocols. And ws/wss is NOT disabled in Firefox.

Firefox是否曾经将ws握手发送到代理,即没有CONNECT?

Does Firefox ever send the ws handshake to the proxy, i.e. no CONNECT?

这与安全性有关.我需要确保没有WebSocket通信通过.同时,我想避免过度使用:禁止使用javascript,禁止使用某些网站.

This is about security. I need to make sure that no WebSocket communication slips through. At the same time I want to avoid overkill: No disabling of javascript, no disallowing certain web sites.

推荐答案

这可能无法回答您的直接问题,但我认为它可以满足您的目标.

This might not answer your direct question, but I think it satisfies your goal.

您仍然可以通过输入URL about:config然后搜索

You can still disable WebSockets by entering the URL about:config and then searching for

network.websocket.max-connections

network.websocket.max-connections

您可以将其值设置为0,以防止创建新的WebSocket.

which you can set the value to 0 to prevent new WebSockets from being created.

这篇关于在Firefox或我的代理中禁用websocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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