fcicq
V2EX  ›  Node.js

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

  •  
  •   fcicq · Aug 4, 2016 · 4255 views
    This topic created in 3772 days ago, the information mentioned may be changed or developed.

    需要 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 可能受不了, 所以就不公开服务器端具体做法了.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   925 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:25 · PVG 04:25 · LAX 12:25 · JFK 15:25
    ♥ Do have faith in what you're doing.