| Summary: | sec-websocket-origin header missing | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Tilman Schlenker <tilman.schlenker> |
| Component: | server | Assignee: | Greg Wilkins <gregw> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | jetty-inbox |
| Version: | unspecified | ||
| Target Milestone: | 7.0.2.RC0 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
This is a change in the websocket protocol from version -75 to -76 of the whatwg draft proposal. I have been waiting for a browser that implements it before supporting it in the server. So it looks like we'll have to get the webkit nightly and try that out. ready for 7.1.4 Resolved -> Closed |
Build Identifier: 20100523 When trying to connect to jetty websockets from WebKit nightly (6531.22.7, r60082) it fails with the message: Error during WebSocket handshake: 'sec-websocket-origin' header is missing It works with Chrome on mac Reproducible: Always Steps to Reproduce: against below servlet code try to open a WebSocket connection. As stated the same code works against Chrome, so this might be a WebKit nightly bug, I am unsure if this is required per spec. package com.avid.osgi.services.websocket; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.websocket.WebSocket; import org.eclipse.jetty.websocket.WebSocketServlet; public class ChatSocketServlet extends WebSocketServlet { private final List<ChatSocket> members = new ArrayList<ChatSocket>(); @Override protected WebSocket doWebSocketConnect(HttpServletRequest httpServletRequest, String s) { return new ChatSocket(); } class ChatSocket implements WebSocket { private Outbound outbound; @Override public void onConnect(Outbound outbound) { this.outbound = outbound; members.add(this); } @Override public void onMessage(byte frame, String data) { for (ChatSocket s : members) { try { s.outbound.sendMessage(frame,data); } catch (IOException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } } @Override public void onMessage(byte b, byte[] bytes, int i, int i1) { } @Override public void onDisconnect() { members.remove(this); } } }