Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any default values for connection hostname? #383

Open
ssorj opened this issue Apr 20, 2022 · 4 comments
Open

Any default values for connection hostname? #383

ssorj opened this issue Apr 20, 2022 · 4 comments

Comments

@ssorj
Copy link
Collaborator

ssorj commented Apr 20, 2022

If I set "host" but not "hostname" in the connection options, is there any defaulting of "hostname" done?

I'm working with somebody who is using Rhea in combination with Qpid Dispatch Router, with a vhost policy config. When they use Qpid Proton C++, it seems to default the hostname field. Rhea does not appear to.

And then, if this is truly a difference, should Rhea default it?

@ssorj
Copy link
Collaborator Author

ssorj commented Apr 20, 2022

Qpid Proton:

~$ PN_TRACE_FRM=1 qconnect
[0x55dcadbb1860]: SASL:FRAME:  -> SASL
[0x55dcadbb1860]: SASL:FRAME:  <- SASL
[0x55dcadbb1860]: AMQP:FRAME:0 <- @sasl-mechanisms(64) [sasl-server-mechanisms=@<symbol>[:GSS-SPNEGO, :GSSAPI, :DIGEST-MD5, :CRAM-MD5, :ANONYMOUS]]
[0x55dcadbb1860]: AMQP:FRAME:0 -> @sasl-init(65) [mechanism=:ANONYMOUS, initial-response=b"anonymous@localhost.localdomain"]
[0x55dcadbb1860]: AMQP:FRAME:0 <- @sasl-outcome(68) [code=0x0]
[0x55dcadbb1860]: AMQP:FRAME:  -> AMQP
[0x55dcadbb1860]: AMQP:FRAME:0 -> @open(16) [container-id="qconnect-f7732f72", hostname="localhost", channel-max=0x7fff]
[0x55dcadbb1860]: AMQP:FRAME:  <- AMQP
[0x55dcadbb1860]: AMQP:FRAME:0 <- @open(16) [container-id="broker-9c177377", channel-max=0x7fff]
qconnect-f7732f72: Connected to amqp://localhost:5672
[0x55dcadbb1860]: AMQP:FRAME:0 -> @close(24) []
[0x55dcadbb1860]:   IO:FRAME:  -> EOS
[0x55dcadbb1860]: AMQP:FRAME:0 <- @close(24) []
[0x55dcadbb1860]:   IO:FRAME:  <- EOS

Rhea:

~/code/equipage/rhea$ DEBUG=rhea* ./connect.js //localhost/abc
  rhea:io [connection-1] connected 127.0.0.1:59042 -> 127.0.0.1:5672 +0ms
  rhea:frames [connection-1] -> { protocol_id: 0, major: 1, minor: 0, revision: 0 } +0ms
  rhea:frames [connection-1]:0 -> open#10 {"container_id":"34fa3d85-cf3d-954f-9486-13929d6cd2d3"}  +3ms
  rhea:raw [connection-1] SENT: 58 0000003a02000000005310d00000002a00000001a12433346661336438352d636633642d393534662d393438362d313339323964366364326433 +0ms
  rhea:io [connection-1] read 8 bytes +5ms
  rhea:frames [connection-1] <- { protocol_id: 0, major: 1, minor: 0, revision: 0 } +1ms
  rhea:io [connection-1] read 36 bytes +0ms
  rhea:io [connection-1] got frame of size 36 +0ms
  rhea:raw [connection-1] RECV: 36 0000002402000000005310c01704a10f62726f6b65722d39633137373337374040607fff +1ms
  rhea:frames [connection-1]:0 <- open#10 {"container_id":"broker-9c177377","channel_max":32767}  +1ms
  rhea:events [connection-1] Connection got event: connection_open +0ms
  rhea:events [34fa3d85-cf3d-954f-9486-13929d6cd2d3] Container got event: connection_open +0ms
CONNECT: Connected to '//localhost/abc'
  rhea:frames [connection-1]:0 -> close#18 {}  +1ms
  rhea:raw [connection-1] SENT: 12 0000000c0200000000531845 +2ms
  rhea:io [connection-1] read 12 bytes +2ms
  rhea:io [connection-1] got frame of size 12 +0ms
  rhea:raw [connection-1] RECV: 12 0000000c0200000000531845 +0ms
  rhea:frames [connection-1]:0 <- close#18 {}  +0ms
  rhea:events [connection-1] Connection got event: connection_close +2ms
  rhea:events [34fa3d85-cf3d-954f-9486-13929d6cd2d3] Container got event: connection_close +0ms

@grs
Copy link
Member

grs commented Apr 21, 2022

If you default it, how do you override that to leave it unspecified (e.g. in order to use the default, whatever that is)?

@ssorj
Copy link
Collaborator Author

ssorj commented Apr 21, 2022

I noticed something else from the Rhea README.md:

"hostname - to present to remote in the open frame (defaults to host)"

https://github.com/amqp/rhea#container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants