Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wei.xuan
getty
Commits
bebfe7b7
Commit
bebfe7b7
authored
Apr 27, 2017
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable js-client now
parent
9608d06e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
change_log.md
echo/ws-echo/change_log.md
+5
-0
addr.js
echo/ws-echo/js-client/addr.js
+1
-0
main.js
echo/ws-echo/js-client/main.js
+9
-5
No files found.
echo/ws-echo/change_log.md
View file @
bebfe7b7
...
...
@@ -10,6 +10,11 @@
## develop history ##
---
-
2017/04/27
> improvement
*
enable wss client just using cert file;
*
js-client can connect wss server by allow-insecure-localhost (chrome://flags/#allow-insecure-localhost)
-
2016/11/19
> 1 add client/app/config.go:GettySessionParam{CompressEncoding} to test compress websocket compression extension.
>
...
...
echo/ws-echo/js-client/addr.js
View file @
bebfe7b7
// var serverAddress = '192.168.8.3:10000';
var
serverAddress
=
'127.0.0.1:10000'
;
// var serverAddress = 'localhost:10000';
echo/ws-echo/js-client/main.js
View file @
bebfe7b7
...
...
@@ -40,11 +40,15 @@ $(function() {
var
$chatPage
=
$
(
'.chat.page'
);
// The chatroom page
// var socket = new WebSocket('ws://192.168.35.1:10000/echo');
var
socket
=
new
WebSocket
(
'wss://'
+
serverAddress
+
'/echo'
,
{
protocolVersion
:
8
,
// origin: 'https://' + serverAddress,
rejectUnauthorized
:
false
});
// var socket = new WebSocket('wss://' + serverAddress + '/echo', {
// // protocolVersion: 8,
// // origin: 'https://' + serverAddress,
// rejectUnauthorized: false,
// });
// http://stackoverflow.com/questions/7580508/getting-chrome-to-accept-self-signed-localhost-certificate#comment33762412_15076602
// chrome://flags/#allow-insecure-localhost
var
socket
=
new
WebSocket
(
'wss://'
+
serverAddress
+
'/echo'
)
// // Setting binaryType to accept received binary as either 'blob' or 'arraybuffer'. In default it is 'blob'.
// socket.binaryType = 'arraybuffer';
// socket.binaryType = ''
...
...
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