Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hel-developer-guide
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
hel-guide
hel-developer-guide
Commits
3ded3cb0
Commit
3ded3cb0
authored
Jan 25, 2018
by
冯景珉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates 框架功能描述/websocket.md
Auto commit by GitBook Editor
parent
fc1d1881
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
websocket.md
框架功能描述/websocket.md
+17
-0
No files found.
框架功能描述/websocket.md
View file @
3ded3cb0
...
@@ -27,6 +27,23 @@
...
@@ -27,6 +27,23 @@
*
mapping中的path表示websocket的连接路径。
*
handler是用于连接的类,必须要实现。
*
interceptors可以对websocket连接进行拦截,在握手前后进行方法调用。
####前端打开websocket连接
```
function initWebSocket() {
socket = new SockJS(contextPath + '/websocket');
socket.onmessage = function (event) {
var data = $.parseJSON(event.data);//获取推送到前端的消息
}
};
```
...
...
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