[undertow-dev] Can't get customed header and attributes in the websocket handshakeheader.

张林 azure.mumu at gmail.com
Tue Apr 8 23:39:09 EDT 2014


Hi,
We registed a web socket handler in the server, waiting for the clients to
connect. According to the usiness, we need to identify (or mark) a client
when it do handshake with the server, so I tried to set some customed
headers in the handshakeheader, just like:
WebSocketConnectionManager manager = new WebSocketConnectionManager(
                webSocketClient, webSocketHandler,
                "ws://localhost:8080/websocket/myHandler");
manager.setAutoStartup(true);
*manager.getHeaders().add("myHeader", "1234567");*
return manager;

I supposed to retrieve it from the WebSocketSession in the serverside, but
I can't get it. it is ok in the jetty server 9.


The server we used: wildfly 8.0.3 Release
The client dependencies:
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.0.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-websocket</artifactId>
            <version>4.0.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax.websocket</groupId>
            <artifactId>javax.websocket-api</artifactId>
            <version>1.0</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
           <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-websockets-jsr</artifactId>
            <version>1.0.3.Final</version>
        </dependency>

This issue blocked me for some days, could you please help to figure out
what's the matter, and it is really appreciate if you can give some advice
to achieve that. Thank you very much!


Sincerely yours,
Lynn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140409/ae9163cf/attachment-0001.html 


More information about the undertow-dev mailing list