Commit Graph

11 Commits

Author SHA1 Message Date
Wichert Akkerman
38bdcaec36 Do not copy more bytes than were read 2019-10-28 16:38:10 +01:00
Wichert Akkerman
ffadd331dd Add a go function to always read websockets
Websocket need to have a Reader running at all times in order to
allow Ping to work (because a Reader is the only thing that will
correctly handle control frames). To faciliate this a go function
is introduced that will always read from the websocket until it
is cancelled. Read data is passed to the transport via a channel.
2019-10-28 16:38:10 +01:00
Wichert Akkerman
92329b48e6 Transports need to handle open/close stanzas
XMPP and WebSocket transports require different open and close stanzas. To
handle this the responsibility handling those and creating the XML decoder is
moved to the Transport.
2019-10-28 16:38:10 +01:00
Wichert Akkerman
25fd476328 Negotiate xmpp websocket subprotocol 2019-10-28 16:38:10 +01:00
Wichert Akkerman
36e153f981 Allow transports to define their own ping mechanism 2019-10-28 16:38:10 +01:00
Wichert Akkerman
87ff01ac68 Fix websocket connect timeout 2019-10-28 16:38:10 +01:00
Wichert Akkerman
01d78a1e5c Fix error result from Transport.Connect errors 2019-10-28 16:38:10 +01:00
Wichert Akkerman
a189748b9c Fix test for ws connection 2019-10-28 16:38:10 +01:00
Wichert Akkerman
8db608ccc1 Add IsSecure() to Transport 2019-10-28 16:38:10 +01:00
Wichert Akkerman
7fa4b06705 Move address into transport config
This makes it possible to use a factory function to create a transport of the right type and not having to repeat the address when calling Transport.Connect()
2019-10-28 16:38:10 +01:00
Wichert Akkerman
66e219844b Add a websocket transport 2019-10-28 16:38:10 +01:00