Socket.io 安全问题 [英] Socket.io Security Issues

查看:88
本文介绍了Socket.io 安全问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过以下方式保护我的 socket.io 与服务器的连接.

I'm wondering how I could secure my socket.io connection to the server from th following.

安全问题:

  • 什么可以阻止恶意用户通过客户端代码连接到套接字服务器?

示例:

OUTSIDE DOMAIN REQUEST var socket = io.connect('http://Mydomain', {port: 4000});

  • 用户似乎只需打开不同的浏览器窗口即可创建数千个并发连接.
  • 我该如何预防这些问题?

    How can I prevent these issues?

    推荐答案

    您应该能够检查服务器端 HTTP 引用是否正确.检查 socket.io 规范以获取有关 http 引用和握手的信息.

    You should be able to check serverside that the HTTP referrer is correct. Check the socket.io spec for info on both http referring as well as handshaking.

    https://github.com/socketio/socket.io-protocol

    还有 0.8 有推荐人验证.以前没用过,但这里可能是一个开始寻找的地方:

    Also 0.8 has referrer verification. Havent used it before, but this may be a place to start looking:

    https://github.com/LearnBoost/socket.io/pull/481

    这篇关于Socket.io 安全问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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