Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
052ede3f
Commit
052ede3f
authored
9 years ago
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #494 from tevans/websocket-cleanup
Cleanup websocket plugin
parents
7768e4fb
403e3a75
No related merge requests found
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
18 deletions
+44
-18
LocalClientSession.java
...org/jivesoftware/openfire/session/LocalClientSession.java
+1
-1
StreamManager.java
...jivesoftware/openfire/streammanagement/StreamManager.java
+2
-0
changelog.html
src/plugins/websocket/changelog.html
+6
-0
plugin.xml
src/plugins/websocket/plugin.xml
+3
-3
readme.html
src/plugins/websocket/readme.html
+29
-0
StreamManagementPacketRouter.java
...ware/openfire/websocket/StreamManagementPacketRouter.java
+0
-2
WebSocketConnection.java
.../jivesoftware/openfire/websocket/WebSocketConnection.java
+0
-4
XmppWebSocket.java
...va/org/jivesoftware/openfire/websocket/XmppWebSocket.java
+3
-8
No files found.
src/java/org/jivesoftware/openfire/session/LocalClientSession.java
View file @
052ede3f
...
...
@@ -896,7 +896,7 @@ public class LocalClientSession extends LocalSession implements ClientSession {
sb
.
append
(
"<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"><optional/></session>"
);
// Offer XEP-0198 stream management capabilities if enabled.
if
(
JiveGlobals
.
getBooleanProperty
(
"stream.management.active"
,
true
))
{
if
(
JiveGlobals
.
getBooleanProperty
(
StreamManager
.
SM_ACTIVE
,
true
))
{
sb
.
append
(
String
.
format
(
"<sm xmlns='%s'/>"
,
StreamManager
.
NAMESPACE_V2
));
sb
.
append
(
String
.
format
(
"<sm xmlns='%s'/>"
,
StreamManager
.
NAMESPACE_V3
));
}
...
...
This diff is collapsed.
Click to expand it.
src/java/org/jivesoftware/openfire/streammanagement/StreamManager.java
View file @
052ede3f
...
...
@@ -35,6 +35,8 @@ public class StreamManager {
packet
=
p
;
}
}
public
static
final
String
SM_ACTIVE
=
"stream.management.active"
;
/**
* Stanza namespaces
...
...
This diff is collapsed.
Click to expand it.
src/plugins/websocket/changelog.html
View file @
052ede3f
...
...
@@ -44,6 +44,12 @@
Openfire WebSocket Plugin Changelog
</h1>
<p><b>
1.1.3
</b>
-- January 6, 2016
</p>
<ul>
<li>
Update dependencies and documentation for pending Openfire 4.0 release.
</li>
</ul>
<p><b>
1.1.2
</b>
-- December 17, 2015
</p>
<ul>
...
...
This diff is collapsed.
Click to expand it.
src/plugins/websocket/plugin.xml
View file @
052ede3f
...
...
@@ -8,8 +8,8 @@
<name>
Openfire WebSocket
</name>
<description>
Provides WebSocket support for Openfire.
</description>
<author>
Tom Evans
</author>
<version>
1.1.
2
</version>
<date>
12/17/2015
</date>
<version>
1.1.
3
</version>
<date>
01/06/2016
</date>
<url>
https://tools.ietf.org/html/rfc7395
</url>
<minServerVersion>
3.11.0
</minServerVersion>
<minServerVersion>
4.0.0 Alpha
</minServerVersion>
</plugin>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/plugins/websocket/readme.html
View file @
052ede3f
...
...
@@ -71,5 +71,34 @@ connector. To establish a secure WebSocket, modify the following URL as appropri
wss://your.openfire.host:7443/ws/
</pre>
<h2>
Configuration
</h2>
<p>
The WebSocket plugin implements the Stream Management (
<a
href=
"http://xmpp.org/extensions/xep-0198.html"
>
XEP-0198
</a>
)
"ack" capabilities introduced with Openfire 4.0. This provides assurance for XMPP packet delivery by allowing the peers
to agree on the number of stanzas exchanged. Two system properties are available to configure this feature:
</p>
<dl>
<dt><pre>
stream.management.active
</pre></dt>
<dd>
Boolean property to enable/disable stream management (default: true)
</dd>
<dt><pre>
stream.management.unsolicitedAckFrequency
</pre></dt>
<dd>
Integer property indicating frequency of unsolicited ack's from the server to the client (default: 0)
</dd>
</dl>
<p>
XEP-0198 allows either party (client or server) to send unsolicited ack/answer
stanzas on a periodic basis. This implementation approximates BOSH ack behavior
by sending unsolicited
<a
/>
stanzas from the server to the client after a
configurable number of stanzas have been received from the client.
</p>
<p>
Setting the system property to "1" would indicate that each client packet should
be ack'd by the server when stream management is enabled for a particular stream.
To disable unsolicited server acks, use the default value for system property
"stream.management.unsolicitedAckFrequency" ("0"). This setting does not affect
server responses to explicit ack requests from the client.
</p>
</body>
</html>
This diff is collapsed.
Click to expand it.
src/plugins/websocket/src/java/org/jivesoftware/openfire/websocket/StreamManagementPacketRouter.java
View file @
052ede3f
...
...
@@ -15,8 +15,6 @@
*/
package
org
.
jivesoftware
.
openfire
.
websocket
;
import
java.io.UnsupportedEncodingException
;
import
org.dom4j.Element
;
import
org.jivesoftware.openfire.SessionPacketRouter
;
import
org.jivesoftware.openfire.multiplex.UnknownStanzaException
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/websocket/src/java/org/jivesoftware/openfire/websocket/WebSocketConnection.java
View file @
052ede3f
...
...
@@ -19,13 +19,10 @@ import java.net.InetSocketAddress;
import
org.dom4j.Namespace
;
import
org.jivesoftware.openfire.PacketDeliverer
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.auth.UnauthorizedException
;
import
org.jivesoftware.openfire.net.VirtualConnection
;
import
org.jivesoftware.openfire.nio.OfflinePacketDeliverer
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionManagerImpl
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.xmpp.packet.Packet
;
import
org.xmpp.packet.StreamError
;
...
...
@@ -35,7 +32,6 @@ import org.xmpp.packet.StreamError;
*/
public
class
WebSocketConnection
extends
VirtualConnection
{
private
static
final
String
CLIENT_NAMESPACE
=
"jabber:client"
;
private
InetSocketAddress
remotePeer
;
private
XmppWebSocket
socket
;
private
PacketDeliverer
backupDeliverer
;
...
...
This diff is collapsed.
Click to expand it.
src/plugins/websocket/src/java/org/jivesoftware/openfire/websocket/XmppWebSocket.java
View file @
052ede3f
...
...
@@ -41,6 +41,7 @@ import org.jivesoftware.openfire.net.SASLAuthentication;
import
org.jivesoftware.openfire.net.SASLAuthentication.Status
;
import
org.jivesoftware.openfire.session.ConnectionSettings
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.openfire.streammanagement.StreamManager
;
import
org.jivesoftware.util.JiveConstants
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.TaskEngine
;
...
...
@@ -304,7 +305,7 @@ public class XmppWebSocket {
sb
.
append
(
String
.
format
(
"<session xmlns='%s'><optional/></session>"
,
"urn:ietf:params:xml:ns:xmpp-session"
));
if
(
isStreamManagementAvailable
())
{
sb
.
append
(
String
.
format
(
"<sm xmlns='%s'/>"
,
"urn:xmpp:sm:3"
));
sb
.
append
(
String
.
format
(
"<sm xmlns='%s'/>"
,
StreamManager
.
NAMESPACE_V3
));
}
}
...
...
@@ -365,13 +366,7 @@ public class XmppWebSocket {
}
private
boolean
isStreamManagementAvailable
()
{
try
{
// use reflection to determine whether stream management is supported
Class
.
forName
(
"org.jivesoftware.openfire.streammanagement.StreamManager"
);
return
JiveGlobals
.
getBooleanProperty
(
"stream.management.active"
,
true
);
}
catch
(
ClassNotFoundException
cnfe
)
{
return
false
;
}
return
JiveGlobals
.
getBooleanProperty
(
StreamManager
.
SM_ACTIVE
,
true
);
}
//-- Keep-alive ping for idle peers
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment