2 Replies Latest reply on Oct 21, 2014 10:56 AM by danorcal

    STOMP over WebSockets on port 80

    danorcal Newbie

      I'm trying to run a STOMP over WebSockets client behind a corporate firewall which only allows outbound traffic on ports 80 and 443. I'm using WildFly 8.1.0.Final (hornetq 2.4.1.Final).

       

      I can create a STOMP over WebSockets acceptor on an arbitrary port like this:

       

                          <acceptor name="stomp-acceptor">

                              <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                              <param key="port" value="8081"/>

                          </acceptor>

       

      but if I use the http port (8080 on my dev machine), I get:

       

      12:28:20,879 ERROR [org.hornetq.core.server] (ServerService Thread Pool -- 56) HQ224000: Failure in initialisation: java.net.BindException: Address already in use

        at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.7.0_67]

        at sun.nio.ch.Net.bind(Net.java:444) [rt.jar:1.7.0_67]

        at sun.nio.ch.Net.bind(Net.java:436) [rt.jar:1.7.0_67]

        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) [rt.jar:1.7.0_67]

        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [rt.jar:1.7.0_67]

        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:102) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:479) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.DefaultChannelPipeline$HeadHandler.bind(DefaultChannelPipeline.java:1000) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.DefaultChannelHandlerContext.invokeBind(DefaultChannelHandlerContext.java:457) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.DefaultChannelHandlerContext.bind(DefaultChannelHandlerContext.java:442) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:842) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:194) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:338) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [netty-all-4.0.15.Final.jar:4.0.15.Final]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

       

      I'm thinking there might be a way to use an http-acceptor, but I can't find any documentation on how to do that.

       

      Any ideas?

       

      Thanks.

        • 1. Re: STOMP over WebSockets on port 80
          Yong Hao Gao Master

          Did you just try the 'http-acceptor' in your configuration? I think it's in the standalone-full.xml file already.

          • 2. Re: STOMP over WebSockets on port 80
            danorcal Newbie

            Here's the acceptors in my standalone-full.xm (this is the default in Wildfly 8.1.0.Final):

             

                            <acceptors>

                                <http-acceptor http-listener="default" name="http-acceptor"/>

                                <http-acceptor http-listener="default" name="http-acceptor-throughput">

                                    <param key="batch-delay" value="50"/>

                                    <param key="direct-deliver" value="false"/>

                                </http-acceptor>

                                <in-vm-acceptor name="in-vm" server-id="0"/>

                         </acceptors>

             

            Trying to connect to "ws://localhost:8080/stomp" returns a 404.