how to setup listen address in rabbitmq_web_stomp plugin

388 views
Skip to first unread message

Zdenek Prejza

unread,
Apr 15, 2016, 4:02:24 PM4/15/16
to rabbitmq-users
Hello, all,

How can I setup listen/bind address in rabbitmq_web_stomp plugin ? I am able to setup multiple ports. No problem.

    {rabbitmq_web_stomp, [{port, [15674, 15675]}]}


But it binds to all ip addresses:

tcp        0      0 0.0.0.0:15674           0.0.0.0:*               LISTEN      3866/beam.smp  
tcp        0      0 0.0.0.0:15675           0.0.0.0:*               LISTEN      3866/beam.smp  

I have tried configuration like {rabbitmq_web_stomp, [{ip, "10.10.10.10"}]} but no results.

It would be great I can have port 15674 and 15675 just on address lets say 10.10.10.10

Rabbitmq version 3.5.3

Thank you so much

Michael Klishin

unread,
Apr 15, 2016, 4:34:29 PM4/15/16
to rabbitm...@googlegroups.com
Have you checked "Configuration" in the Web STOMP doc guide [1]?


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Zdenek Prejza

unread,
Apr 15, 2016, 4:42:24 PM4/15/16
to rabbitmq-users
Yes, I have. That why i tried:


"""
I have tried configuration like {rabbitmq_web_stomp, [{ip, "10.10.10.10"}]} but no results.
""

Maybe, i just didnt understand the syntax.

Dne pátek 15. dubna 2016 22:34:29 UTC+2 Michael Klishin napsal(a):

Michael Klishin

unread,
Apr 15, 2016, 5:42:36 PM4/15/16
to rabbitm...@googlegroups.com
You are using a shortcut which can only configure port, the most common setting.

Most TCP listener options use rabbitmq_web_stomp.cowboy_opts,
from what I can see in the source.

Unfortunately I don't have an example of that at hand right now. 

dfed...@pivotal.io

unread,
Apr 18, 2016, 6:06:40 AM4/18/16
to rabbitmq-users
'ip' option should be defined in 'tcp_config' proplist. 
So it would be: {rabbitmq_web_stomp, [{tcp_config, [{ip, "10.10.10.10"}]}

Zdenek Prejza

unread,
Apr 18, 2016, 6:14:39 AM4/18/16
to rabbitmq-users
I have just tried it, again

tcp        0      0 0.0.0.0:15674           0.0.0.0:*               LISTEN      5125/beam.smp  

I will try to have a look into the documentation in the evening.

yOz

unread,
Jun 1, 2017, 9:59:39 AM6/1/17
to rabbitmq-users
I have still no luck. Only port definition is working for me

{rabbitmq_web_stomp, [{port, [15674, 15675, 15676, 15677,
        15678, 15679, 15680, 15681, 15682, 15683]}]}

It binds to all addresses and defined ports.

Dne pondělí 18. dubna 2016 12:14:39 UTC+2 yOz napsal(a):

Luke Bakken

unread,
Jun 1, 2017, 4:02:27 PM6/1/17
to rabbitmq-users
yOz,

The "Configuration" section in the Web STOMP plugin guide mentions the Ranch documentation.

Following that link,  you'll notice that TCP sockets managed by Ranch (which are then used by the STOMP plugin) take the following option:

{ip, inet:ip_address()}

The best way to find documentation for that type is in the inet module docs.

You'll see that inet:ip4_address() is a 4-tuple: {0..255, 0..255, 0..255, 0..255}

So, based on that, the following configuration file worked to set both the listening IP to 127.0.0.1 and port to 12345 for the STOMP plugin:

[
    {rabbitmq_web_stomp, [
      {tcp_config, [{ip, {127, 0, 0, 1}}, {port, 12345}]}
    ]}
].

Let me know if this works in your environment.
Luke

Zdenek Prejza

unread,
Jun 1, 2017, 4:19:00 PM6/1/17
to rabbitm...@googlegroups.com
Thank you for you answer. I have just done a quick test, no progress.

conf just with:


[
    {rabbitmq_web_stomp, [
      {tcp_config, [{ip, {127, 0, 0, 1}}, {port, 12345}]}
    ]}
].


=INFO REPORT==== 1-Jun-2017::22:16:04 ===
Starting RabbitMQ 3.5.3 on Erlang 17.3
Copyright (C) 2007-2014 GoPivotal, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/
.
.

=INFO REPORT==== 1-Jun-2017::22:16:06 ===
rabbit_web_stomp: listening for HTTP connections on 0.0.0.0:15674

I will try to have a look at the ranch doc as well.


--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/y-_NAAMPGd4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

Luke Bakken

unread,
Jun 1, 2017, 4:24:39 PM6/1/17
to rabbitmq-users
Hi yOZ,

Please double-check by looking at the output of netstat or ss. I also see that output in my log file, but netstat shows this:

$ sudo netstat -pan|fgrep -i beam
tcp        0      0 127.0.0.1:12345         0.0.0.0:*               LISTEN      26572/beam.smp      
tcp        0      0 192.168.1.5:5672        0.0.0.0:*               LISTEN      26572/beam.smp      
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      26572/beam.smp      
tcp        0      0 127.0.0.1:57719         127.0.0.1:4369          ESTABLISHED 26572/beam.smp      
tcp6       0      0 :::61613                :::*                    LISTEN      26572/beam.smp      
unix  3      [ ]         STREAM     CONNECTED     772146   26572/beam.smp

It appears that the log message is incorrect.

To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

Zdenek Prejza

unread,
Jun 1, 2017, 4:29:51 PM6/1/17
to rabbitm...@googlegroups.com
Hi Luke,
thank you. I did it

# netstat -pan | fgrep -i beam
tcp        0      0 0.0.0.0:15674           0.0.0.0:*               LISTEN      25274/beam.smp 
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      25274/beam.smp 
tcp        0      0 127.0.0.1:42419         127.0.0.1:4369          ESTABLISHED 25274/beam.smp 
tcp6       0      0 :::5672                 :::*                    LISTEN      25274/beam.smp 
tcp6       0      0 :::61613                :::*                    LISTEN      25274/beam.smp

What version are you running?


To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

Michael Klishin

unread,
Jun 1, 2017, 4:41:52 PM6/1/17
to rabbitm...@googlegroups.com
Hi Zdenek,

You run RabbitMQ 3.5.3 and I don't think that version uses Ranch. Ranch was
introduced in 3.6.0 IIRC:


suggests that we moved to Ranch in the fall of 2015, and 3.5.3 was released

The docs on rabbitmq.com cover the most recent stable release.

You can access 3.5.x documentation at previous.rabbitmq.com:


To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.

To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Bakken

unread,
Jun 1, 2017, 4:46:00 PM6/1/17
to rabbitmq-users
As Michael pointed out, I'm testing this with a much newer version (3.6.X series). Sorry for the confusion.

Luke
Reply all
Reply to author
Forward
0 new messages