Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WebSocket-BroadCaster
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
WebSocket-BroadCaster
Commits
e16aee0f
Commit
e16aee0f
authored
Mar 03, 2016
by
Xiaohe Cao
Committed by
Romain Courteaud
Mar 03, 2016
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update websocket-server to use chrome.sockets API.
The chrome.socket API is deprecated since Chrome 33.
parent
ccbc1ab8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
183 additions
and
92 deletions
+183
-92
http.js
http.js
+168
-84
index.js
index.js
+4
-4
manifest.json
manifest.json
+11
-4
No files found.
http.js
View file @
e16aee0f
This diff is collapsed.
Click to expand it.
index.js
View file @
e16aee0f
...
...
@@ -64,12 +64,12 @@ if (http.Server && http.WebSocketServer) {
wsServer
.
addEventListener
(
'
request
'
,
function
(
req
)
{
var
socket
=
req
.
accept
();
socket_dict
[
socket
.
socketId_
]
=
{
socket_dict
[
socket
.
pSocket_
.
socketId
]
=
{
socket
:
socket
};
chrome
.
socket
.
getInfo
(
socket
.
socketId_
,
function
(
result
)
{
chrome
.
socket
s
.
tcp
.
getInfo
(
socket
.
pSocket_
.
socketId
,
function
(
result
)
{
if
((
result
!==
undefined
)
&&
(
result
.
connected
))
{
socket_dict
[
socket
.
socketId_
].
peer
=
result
.
peerAddress
+
'
:
'
+
result
.
peerPort
;
socket_dict
[
socket
.
pSocket_
.
socketId
].
peer
=
result
.
peerAddress
+
'
:
'
+
result
.
peerPort
;
updateStatus
(
socket_dict
);
}
});
...
...
@@ -87,7 +87,7 @@ if (http.Server && http.WebSocketServer) {
// When a socket is closed, remove it from the list of connected sockets.
socket
.
addEventListener
(
'
close
'
,
function
()
{
delete
socket_dict
[
socket
.
socketId_
];
delete
socket_dict
[
socket
.
pSocket_
.
socketId
];
updateStatus
(
socket_dict
);
});
return
true
;
...
...
manifest.json
View file @
e16aee0f
...
...
@@ -6,10 +6,17 @@
"minimum_chrome_version"
:
"44"
,
"offline_enabled"
:
true
,
"manifest_version"
:
2
,
"permissions"
:
[
"system.network"
,
{
"socket"
:
[
"tcp-connect"
,
"tcp-listen"
]}],
"permissions"
:
[
"system.network"
],
"sockets"
:
{
"tcp"
:
{
"connect"
:
"*"
},
"tcpServer"
:
{
"listen"
:
"*"
}
},
"app"
:
{
"background"
:
{
...
...
Romain Courteaud
@romain
mentioned in merge request
!1 (closed)
·
Mar 03, 2016
mentioned in merge request
!1 (closed)
mentioned in merge request !1
Toggle commit list
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