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

how to rescrict route domain? #20

Closed vinnitu closed 11 years ago

vinnitu commented 12 years ago

Is there any option in config to restrict route="xmpp:domain:port"?

dhruvbird commented 12 years ago

nope, but you can easily override the behaviour by modifying the route_parse() function. The route attribute can be anything and it is up to the implementation to make sense of it.

vinnitu commented 12 years ago

not very good ((( because admin cannot deploy service without programer (just edit config file)

dhruvbird commented 12 years ago

XEP-0124 doesn't mandate a specific format on route and there are deployments that use a custom route format to determine the endpoint of the xmpp server. The default behaviour is to ignore anything that doesn't look like xmpp:domain:port so it is probably already what you want.

vinnitu commented 12 years ago

i like config way for example 'host-unknown' terminate condition from http://xmpp.org/extensions/xep-0124.html#errorstatus-terminal will be better, imho

dhruvbird commented 12 years ago

The bosh spec. does not require the route attribute to be of any specific format - I think that is where the confusion is. Additionally, other installations rely on this behaviour.

However, if someone is going to override this default behaviour, they need to change this piece of code as well, so it makes sense to raise a 'host-unknown' error for an invalid 'route' attribute.