1. 程式人生 > >webscoket 碰見的錯誤記錄

webscoket 碰見的錯誤記錄

unexpected response code : 400  ,由於路徑錯誤引起的

我的伺服器 使用了 nginx  代理, 在jsp 頁面使用

request.getServerPort() 始終為  80, 因為在 nginx 的設定裡面: 這個埠設定預設是80,

由於生產環境不敢動, 於是就在jsp 頁面指定 tomcat的埠就可以了。

unexpected response code : 403:  需要加入許可, 加入 setAllowedOrigins("*"),  為* 是任何地址, 也可以指定

地址bid如: "http://localhost"