{"action":"created","issue":{"url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/5","repository_url":"https://api.github.com/repos/redsolution/xabber-websocket","labels_url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/5/comments","events_url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/5/events","html_url":"https://github.com/redsolution/xabber-websocket/issues/5","id":379513808,"node_id":"MDU6SXNzdWUzNzk1MTM4MDg=","number":5,"title":"missing jabber:client namespace on stanzas","user":{"login":"agnauck","id":1344950,"node_id":"MDQ6VXNlcjEzNDQ5NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1344950?v=4","gravatar_id":"","url":"https://api.github.com/users/agnauck","html_url":"https://github.com/agnauck","followers_url":"https://api.github.com/users/agnauck/followers","following_url":"https://api.github.com/users/agnauck/following{/other_user}","gists_url":"https://api.github.com/users/agnauck/gists{/gist_id}","starred_url":"https://api.github.com/users/agnauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnauck/subscriptions","organizations_url":"https://api.github.com/users/agnauck/orgs","repos_url":"https://api.github.com/users/agnauck/repos","events_url":"https://api.github.com/users/agnauck/events{/privacy}","received_events_url":"https://api.github.com/users/agnauck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-11T11:30:15Z","updated_at":"2018-11-22T09:06:59Z","closed_at":null,"author_association":"NONE","body":"the jabber:client namespace is missing on stanzas. This causes several clients and libraries fail to connect.\r\n\r\nSee here from a log from stanza.io which hangs on resource binding because its namespace aware and expects the response Iq to be in the jabber:client xml namespace:\r\n```\r\nSend:\r\n<iq xmlns=\"jabber:client\" type=\"set\" id=\"578b0ba8-cb98-46a2-a383-3de028c081f9\">\r\n   <bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>\r\n</iq>\r\n\r\nRecv:\r\n<iq id='578b0ba8-cb98-46a2-a383-3de028c081f9' type='result'>\r\n   <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>\r\n      <jid>alex@server.com/6ec5214c-4afa-46c4-b3da-f6bc42ac345e</jid>\r\n   </bind>\r\n</iq>\r\n```"},"comment":{"url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/comments/440960795","html_url":"https://github.com/redsolution/xabber-websocket/issues/5#issuecomment-440960795","issue_url":"https://api.github.com/repos/redsolution/xabber-websocket/issues/5","id":440960795,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDk2MDc5NQ==","user":{"login":"agnauck","id":1344950,"node_id":"MDQ6VXNlcjEzNDQ5NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1344950?v=4","gravatar_id":"","url":"https://api.github.com/users/agnauck","html_url":"https://github.com/agnauck","followers_url":"https://api.github.com/users/agnauck/followers","following_url":"https://api.github.com/users/agnauck/following{/other_user}","gists_url":"https://api.github.com/users/agnauck/gists{/gist_id}","starred_url":"https://api.github.com/users/agnauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnauck/subscriptions","organizations_url":"https://api.github.com/users/agnauck/orgs","repos_url":"https://api.github.com/users/agnauck/repos","events_url":"https://api.github.com/users/agnauck/events{/privacy}","received_events_url":"https://api.github.com/users/agnauck/received_events","type":"User","site_admin":false},"created_at":"2018-11-22T09:06:59Z","updated_at":"2018-11-22T09:06:59Z","author_association":"NONE","body":"> WS Server not change stanzas, it only forwards them\r\n\r\nthis is exactly the issue when you forward the complete text of a stanza without referencing it to the complete XMPP stream.\r\n\r\nHere is a pseudo stream.\r\n```\r\n<stream:stream\r\n    from='example.com'\r\n    xmlns='jabber:client'\r\n    xmlns:stream='http://etherx.jabber.org/streams'\r\n    version='1.0'>\r\n<iq type=\"set\" id=\"578b0ba8-cb98-46a2-a383-3de028c081f9\">\r\n   <bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>\r\n</iq>\r\n</stream:stream>\r\n```\r\nthe default namespace is defined on the stream header (jabber:client). It gets inherited by default to all child stanzas, this is why it is omitted on the iq stanza in this sample here.\r\n\r\nBy just forwarding the text/string of the stanza you are putting it in the default XML namespace, instead of the jabber:client namespace on the websocket connection.\r\n\r\nStanzas in websocket frames must be independently parsable XML documents, and also conform to the namespaces defined in the XMPP core specs. This is why you have to rewrite the stanza and add the namespace back. By not doing this the implementation will not be compatible will fully namespace aware client implementations, while it still may work with implementations which are not that strict."}}
{"actor":{"display_login":"agnauck"}}