zoukankan      html  css  js  c++  java
  • Node.js how to respond to an upgrade request?

    You just need to call socket.write with the appropriate HTTP syntax as plain text along these lines (from wikipedia):

    HTTP/1.1 101 Switching Protocols
    Upgrade: websocket
    Connection: Upgrade
    Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
    Sec-WebSocket-Protocol: chat

    Use   line separators. After that point, HTTP is over and now you are just using the bare TCP socket.

  • 相关阅读:
    SpringMVC扩展
    反射机制
    python day9
    python day8
    python day7
    python day6
    python day4
    python day3
    python day2
    python day1
  • 原文地址:https://www.cnblogs.com/huenchao/p/6233678.html
Copyright © 2011-2022 走看看