国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Handshake failed due to invalid Upgrade header: null 解決方案以及連接60s,信息不交互,連接斷開

這篇具有很好參考價值的文章主要介紹了Handshake failed due to invalid Upgrade header: null 解決方案以及連接60s,信息不交互,連接斷開。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

Handshake failed due to invalid Upgrade header: null 解決方案以及連接60s,信息不交互,連接斷開

1. 問題背景:因為后端用了nginx代理,所以websocket連接的過程中報錯:Handshake failed due to invalid Upgrade header: null
2. 解決辦法:在nginx中添加以下代碼:

啟用支持websocket連接

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout   3600s; // 超時設(shè)置

說明:
proxy_http_version: 1.1;(告訴nginx使用HTTP/1.1通信協(xié)議,這是websocket必須要使用的協(xié)議)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";(告訴nginx,當它想要使用Websocket時,響應(yīng)http升級請求)
proxy_read_timeout 3600s;( 超時設(shè)置, 如果不設(shè)置的話,默認60s,60s內(nèi)沒有信息交互,將自動斷開)
代碼截圖:
Handshake failed due to invalid Upgrade header: null 解決方案以及連接60s,信息不交互,連接斷開,nginx,websocket,Java,nginx,websocket,spring boot文章來源地址http://www.zghlxwxcb.cn/news/detail-534255.html

到了這里,關(guān)于Handshake failed due to invalid Upgrade header: null 解決方案以及連接60s,信息不交互,連接斷開的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Installation failed due to: ‘Failed to commit install session 2076767024 wit

    Installation failed due to: ‘Failed to commit install session 2076767024 wit

    Installation failed due to: \\\'Failed to commit install session 2076767024 wit Android studio導(dǎo)入項目時出現(xiàn)安裝app失?。褐苯釉谠撐募刑砑酉旅鎯?nèi)容 ?

    2024年02月11日
    瀏覽(15)
  • Account locked due to X failed logins

    機器到期改密碼后,業(yè)務(wù)報錯,服務(wù)無法啟動。 業(yè)務(wù)監(jiān)控頁面顯示服務(wù)未啟動 1、檢查業(yè)務(wù)日志未發(fā)現(xiàn)異常(原因是一線人員手動重啟了服務(wù),未使用管理平臺操作) 2、根據(jù)修改密碼的動作檢查ssh日志發(fā)現(xiàn),頻繁有訪問失敗的請求 3、從別的機器訪問出問題的機器,發(fā)現(xiàn)無法

    2024年02月10日
    瀏覽(18)
  • 解決cloudflare worker遇到failed to dial to (wss://): 200 OK > websocket: bad handshake 的問題

    解決cloudflare worker遇到failed to dial to (wss://): 200 OK > websocket: bad handshake 的問題

    destination common/retry: [transport/internet/websocket: failed to dial WebSocket transport/internet/websocket: failed to dial to (wss://cw.fjh1997.top/): 200 OK websocket: bad handshake] common/retry: all retry attempts failed 開發(fā)的時候遇到這個問題,奈何瀏覽器抓不了websocket的握手包,正常握手包是101狀態(tài)碼的http數(shù)據(jù)包,但

    2024年03月14日
    瀏覽(42)
  • webSocket connection to ‘xx‘ failed: Error during WebSocket handshake: Unexpected response code: 200

    正確建立websocket連接后,返回狀態(tài)碼101,不會返回200等。 websocket相關(guān)nginx代理內(nèi)容

    2024年02月08日
    瀏覽(20)
  • ERROR: Could not install packages due to an OSError: [WinError 5] 拒絕訪問 解決方案

    ERROR: Could not install packages due to an OSError: [WinError 5] 拒絕訪問 解決方案

    ??大家好,我是愛編程的喵喵。雙985碩士畢業(yè),現(xiàn)擔(dān)任全棧工程師一職,熱衷于將數(shù)據(jù)思維應(yīng)用到工作與生活中。從事機器學(xué)習(xí)以及相關(guān)的前后端開發(fā)工作。曾在阿里云、科大訊飛、CCF等比賽獲得多次Top名次?,F(xiàn)為CSDN博客專家、人工智能領(lǐng)域優(yōu)質(zhì)創(chuàng)作者。 ??本文主要介

    2024年02月16日
    瀏覽(25)
  • RemotingConnectException: connect to <null> failed

    RemotingConnectException: connect to <null> failed

    rocketmq? /conf/broker.conf 配置 namesrvAddr=139.*.*.60:9876 brokerIP1=139.*.*.60 ?啟動文件 echo \\\"啟動nameserer\\\" nohup sh bin/mqnamesrv sleep 5 echo \\\"啟動broker\\\" nohup sh bin/mqbroker -n 139.224.194.60:9876 -c conf/broker.conf ? 本地客戶端代碼/main/resources/application.properties 客戶端啟動命令 java -jar target/rocketmq-console-ng

    2024年02月14日
    瀏覽(16)
  • WebSocket connection to ‘ws://127.0.0.1:8080/stomp/ws/1‘ failed: Error during WebSocket handshake:

    WebSocket connection to ‘ws://127.0.0.1:8080/stomp/ws/1‘ failed: Error during WebSocket handshake:

    ** ** 最近研究websocket的時候遇到了這個問題,前端vue 連接 的時候一直連接不上,找了下原因 是Security攔截了 解決辦法就是在SecurityConfig里面添加代碼 這里的/websocket 是根據(jù)你自己設(shè)置地址,并不是確定的一成不變的。詳情如下圖所示:

    2024年02月17日
    瀏覽(20)
  • 解決 Connection to Python debugger failed Socket closed 及 (most likely due to a circular import) 問題處理

    解決 Connection to Python debugger failed Socket closed 及 (most likely due to a circular import) 問題處理

    在debug 過程中,出現(xiàn)了 Connection to Python debugger failed Socket closed 錯誤具體報錯為: Traceback (most recent call last): ? File \\\"/home/Downloads/pycharm-community-2022.3.1/plugins/python-ce/helpers/pydev/pydevd.py\\\", line 45, in module ??? from _pydevd_bundle.pydevd_comm import CMD_SET_BREAK, CMD_SET_NEXT_STATEMENT, CMD_STEP_INTO, CMD

    2024年02月03日
    瀏覽(21)
  • 親測有效!python:Failed to execute script ‘pyi_rth_win32comgenpy‘ due to unhandled exception!

    使用pyinstaller打包exe程序后,出現(xiàn)如下錯誤: Failed to execute script ‘pyi_rth_win32comgenpy’ due to unhandled exception! 其中,使用的部分第三方庫版本: 同時也把同樣腳本發(fā)給同事嘗試打包,同事打包后的程序居然可以運行??! pip list查詢第三方庫版本,我們都是一致的,除了conda庫版

    2024年02月12日
    瀏覽(16)
  • 微信小程序分享到朋友圈,打開鏈接報錯“ogin:fail rejected due to no permission current”

    場景: ? ? ? ? 進入商品詳情頁,點擊分享到朋友圈,打開分享鏈接以后,提示 “l(fā)ogin:fail rejected due to no permission current” 產(chǎn)生原因: ? ? ? ? 從朋友圈分享鏈接點進來,并不會真正的打開小程序,而是進入一個小程序單頁面模式。單頁面模式下存在一定的限制:頁面無登錄

    2024年02月17日
    瀏覽(99)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包