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
    來源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
  • 相关阅读:
    document基本操作 动态脚本-动态样式-创建表格
    js原型模式和继承
    NuGet本地包自定义路径
    技术文档链接收藏
    数据结构排序
    Insertion Sort
    选择排序之javascript
    冒泡排序之javascript
    C++双向链表
    单向链表
  • 原文地址:https://www.cnblogs.com/handsome1013/p/9389127.html
Copyright © 2011-2022 走看看