Package org.xlightweb

Examples of org.xlightweb.BadMessageException


                IHttpRequestHeader header = webStream.getUpgradeRequestHeader();

                // check origin header
                String origin = header.getHeader("Origin");
                if (!isAllowed(origin)) {
                    throw new BadMessageException(403);
                }
               
                // check the subprotocol 
                String subprotocol = header.getHeader("WebSocket-Protocol", "");
                if (!subprotocol.equalsIgnoreCase("mySubprotocol.example.org")) {
                    throw new BadMessageException(501);
                }
            }

            private boolean isAllowed(String origin) {
                // check the origin
View Full Code Here


                IHttpRequestHeader header = webStream.getUpgradeRequestHeader();

                // check origin header
                String origin = header.getHeader("Origin");
                if (!isAllowed(origin)) {
                    throw new BadMessageException(403);
                }
               
                // check the subprotocol 
                String subprotocol = header.getHeader("WebSocket-Protocol", "");
                if (!subprotocol.equalsIgnoreCase("mySubprotocol.example.org")) {
                    throw new BadMessageException(501);
                }
            }
View Full Code Here

TOP

Related Classes of org.xlightweb.BadMessageException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.