Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的计算机上启动一个服务器并加载一个本地 html 文件。当我向服务器发送 Web 套接字请求并检查客户端握手和从服务器发送的握手时,Origin 值不同。我可以操纵这个值或从某个地方设置它吗?如何设置?
您无法更改浏览器发送的原始值。这是一项允许跨域安全的安全功能。您看到的从服务器发回的 Sec-WebSocket-Origin 是Hixie 76版本的协议的一项功能,该功能在最近的协议版本中将消失。