xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Program always uses default xmpp port #3

Closed WasserX closed 12 years ago

WasserX commented 12 years ago

What steps will reproduce the problem?

  1. Run openfire with xmpp in another port (5223)
  2. Use Pidgin to connect using Connection Port 5223 and in BOSH Server port http://url:5280/http-bind/

What is the expected output? What do you see instead? Expected output: Connection to the server Output: Connects to node-xmpp-bosh server and node-xmpp-bosh can't conenct to the XMPP server.

How to solve it? Change the default port to 5223.

What version of the product are you using? On what operating system? Version node-xmpp-bosh 0.5.6 (npm installation) Ubuntu 11.10

Please provide any additional information below. It seems to ignore port information passed by pidgin and to always use default port.

dhruvbird commented 12 years ago

Changing the default port in the config file won't help. When you make the BOSH request, you need to set the 'route' parameter of the target xmpp server to indicate that port 5223 should be used. See the 'route' attribute in http://xmpp.org/extensions/xep-0124.html#session

Ideally, pidgin should have a way to configure this. Alternatively, you need to set up DNS (with correct SRV records) entries to enable node-xmpp-bosh to know the correct end-point.

WasserX commented 12 years ago

I understand that pidgin should do it ideally. And maybe it doesn't. But changing the default port in xmpp-proxy-connector does solve the problem, what makes me think that maybe the variable DEFAULT_XMPP_PORT is always being used.

dhruvbird commented 12 years ago

Yes, the variable DEFAULT_XMPP_PORT controls the default port to use in case no SRV record was found while querying the host you are connecting to. This is expected behaviour. You should ideally have an SRV client record for XMPP to be able to check the connection endpoint. See: http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/ for more details.