V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fcicq
V2EX  ›  Node.js

穿过 SNI Proxy, 用 SNI 和 ALPN 选择具体服务

  •  
  •   fcicq · 2016-08-04 16:08:18 +08:00 · 2788 次点击
    这是一个创建于 2793 天前的主题,其中的信息可能已经有所发展或是发生改变。

    需要 node 5.0.0 以上. 客户端关键代码大致是这样的:

        var clientoptions = {
          port: 443,
          host: sslhost,
          rejectUnauthorized: verifyserver,
          ALPNProtocols: alpnproto.split(','),
          servername: sslservername,
        }
        var remote = tls.connect(clientoptions, function() { ... }
    

    相当于 openssl s_client -connect HOST:443 -servername SERVERNAME -alpn ALPNPROTO

    这个大家都用上的话那些 Proxy 可能受不了, 所以就不公开服务器端具体做法了.

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3571 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:46 · PVG 12:46 · LAX 21:46 · JFK 00:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.