zoukankan      html  css  js  c++  java
  • Websocket拦截器HandshakeInterceptor

    https://www.jianshu.com/p/7c98820f0364

    org.springframework.web.socket.server

    Interface HandshakeInterceptor

    所有已知实现类

    HttpSessionHandshakeInterceptor


    public interface HandshakeInterceptor
    WebSocket握手请求的拦截器. 检查握手请求和响应, 对WebSocketHandler传递属性


    • boolean beforeHandShake(ServerHttpRequest request,ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception
      在握手之前执行该方法, 继续握手返回true, 中断握手返回false. 通过attributes参数设置WebSocketSession的属性
    • void afterHandshake(ServerHttpRequest request,ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception
      在握手之后执行该方法. 无论是否握手成功都指明了响应状态码和相应头.


    作者:写java的逗比叫z1
    链接:https://www.jianshu.com/p/7c98820f0364
    來源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
  • 相关阅读:
    python中的time模块
    CSS 布局
    8 Function类型
    2 node 核心
    1 node 简介
    13 对象
    JS 算法一
    JS 模块化
    1 谈谈section标签
    JS 练习一
  • 原文地址:https://www.cnblogs.com/handsome1013/p/9389127.html
Copyright © 2011-2022 走看看