Project

General

Profile

Feature #2238

Avatar?id=6023&size=22x22

Add support for XMPP Sub-protocol for WebSocket

Added by Andrzej Wójcik Tigase team member over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
2014-09-05
Due date:
2014-12-30
% Done:

100%

Estimated time:
25.00 h
Database:
n/a
Source Code Disclaimer:
Additional charges approved:
No

Description

Right now we have support for XMPP over WebSocket as it is defined in http://www.ietf.org/archive/id/draft-moffitt-xmpp-over-websocket-04.txt but this document is replaced with new document http://tools.ietf.org/html/draft-ietf-xmpp-websocket-09. This new document is still a draft and it contains more changes to original XMPP protocol, but as it is 9th revision I think it would be safe to start implementation of support for this subprotocol.

There is an issue here - new protocol is not compatible with current implementation as current implementation uses only wrapped plain C2S protocol while this new version created new subprotocol. I'm not sure if it will be possible to have them both running on same port (or even if it would be desired as client might not know which protocol it should use if it will know both - as in case of future version of Jaxmpp2)


Related issues

Related to Tigase JaXMPP Client Library - Task #2552: Add implementation for WebSocket to Jaxmpp-J2SEClosed2014-12-212014-12-31

Blocks Tigase JaXMPP Client Library - Feature #2239: Add support for XMPP Sub-protocol for WebSocketClosed2014-09-052014-10-11

Associated revisions

Revision 030581ef (diff)
Added by Andrzej Wójcik Tigase team member over 3 years ago

Issue #2238 - Add support for XMPP Sub-protocol for WebSocket

History

#1 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Blocks Feature #2239: Add support for XMPP Sub-protocol for WebSocket added

#2 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Status changed from New to In Progress

#3 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Status changed from In Progress to In QA
  • Assignee changed from Andrzej Wójcik to Artur Hefczyc
  • % Done changed from 0 to 100

I implemented XMPP subprotocol for WebSocket as described at http://tools.ietf.org/html/draft-ietf-xmpp-websocket-10 which is next version of specification mentioned in issue description.

Everything works as it should and by default server on same port is able to handle both XMPP over WebSocket specification (http://tools.ietf.org/html/draft-ietf-xmpp-websocket-10 and http://www.ietf.org/archive/id/draft-moffitt-xmpp-over-websocket-04.txt) without any configuration. Proper version of protocol is used depending on request sent from client.

In specification it was described that XMPP over WebSocket should work if Sec-WebSocket-Protocol HTTP header contains xmpp as a value and it should report xmpp as used protocol. New implementation just as older one responds with xmpp as a value for used protocol, however new implementation also supports xmpp-framing as a protocol (and this is perfered one by implementation). This means that if client knows both versions of specification (draft-moffit and draft-ietf) but prefers to use newer one, it can send to server list containing xmpp and xmpp-framing as supported protocol and Tigase XMPP Server which supports newer version will respond with xmpp-framing as used protocol so that client will know that new version of protocol is supported. This custom feature was added to allow client to select proper protocol without trying first one and if it fails then trying to use second protocol on next connection as establishing connection could create a delay.

#4 Avatar?id=6023&size=24x24 Updated by Artur Hefczyc Tigase team member over 3 years ago

  • Status changed from In QA to Feedback
  • Assignee changed from Artur Hefczyc to Andrzej Wójcik

Ok, thank you for a good work. The question however is: How can we test it in an automated way? TTS does not support web sockets yet and I wonder if it is worth the effort to add web sockets support to TTS. Maybe we could have some tests based on JaXMPP library which could cover elements not available in TTS and maybe at some point replace TTS entirely.

#5 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Assignee changed from Andrzej Wójcik to Artur Hefczyc

It would be possible to implement WebSocket for Jaxmpp for J2SE environment. Right now we are using in Jaxmpp2 implementation of WebSocket delivered by web browsers so we can not use this in automated tests and we would need to implement support for WebSocket in Jaxmpp2-J2SE to make it possible to add automated testing of WebSocket.

#6 Avatar?id=6023&size=24x24 Updated by Artur Hefczyc Tigase team member over 3 years ago

  • Status changed from Feedback to In QA
  • Assignee changed from Artur Hefczyc to Andrzej Wójcik

As mentioned in the other ticket, I am not qualified for QA for the feature. We need automated tests in order to close these tickets.

Please share all: %bmalkow , %wojtek , %eric your ideas about automated tests. TTS seems to be working more or less but it seems to be nobody favorite tool and adding new tests or maintaining the project is a task nobody wants to do.

Maybe what we need is some kind of GUI/Web tool for creating tests for TTS? I think it would be actually easy to do so as most tests consist of simple:

  1. Send this

  2. Expect this

#7 Updated by Andrzej Wójcik Tigase team member over 3 years ago

I think that to create automated tests we would need WebSocket implementation in Jaxmpp-J2SE so that we could test it at all as we need not only send data but it needs to be framed in WebSocket frames which is impossible without proper implementation of WebSocket in Jaxmpp-J2SE

#8 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Related to Task #2552: Add implementation for WebSocket to Jaxmpp-J2SE added

#9 Updated by Andrzej Wójcik Tigase team member over 3 years ago

  • Due date changed from 2014-10-11 to 2014-12-30
  • Assignee changed from Andrzej Wójcik to Artur Hefczyc
  • Source Code Disclaimer set to No

I prepared WebSocket implementation in Jaxmpp-J2SE which can be used to write automatic tests using ie. TestNG framework as we already did for some of our internal projects.

But the questions are:

Where (in which project) test should be created?

Do we have any environment for this tests to run?

#10 Avatar?id=6023&size=24x24 Updated by Artur Hefczyc Tigase team member over 3 years ago

  • Assignee changed from Artur Hefczyc to Wojciech Kapcia

I thought of either doing this within TTS project or creating a new project just for testing. However, I am not sure if this is the best approach. You have more experience with writing and maintaining tests for our customer so you probably have better idea how to do this best.

Maybe Wojciech, who prepared the whole framework for NP should decide.

#11 Updated by Wojciech Kapcia Tigase team member over 3 years ago

  • Assignee changed from Wojciech Kapcia to Artur Hefczyc

Artur Hefczyc wrote:

Maybe Wojciech, who prepared the whole framework for NP should decide.

I would go with separate project - more clean approach, easier to maintain.

#12 Avatar?id=6023&size=24x24 Updated by Artur Hefczyc Tigase team member over 3 years ago

  • Status changed from In QA to Closed

Also available in: Atom PDF