Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liveserver
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
何硕
liveserver
Commits
3fa4ddab
Commit
3fa4ddab
authored
Aug 15, 2019
by
何硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'heshuo' into 'master'
test wss See merge request
!20
parents
597f5b4d
11abd177
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
index.js
index.js
+11
-7
No files found.
index.js
View file @
3fa4ddab
var
app
=
require
(
'
express
'
)();
var
app
=
require
(
'
express
'
)();
var
http
=
require
(
'
http
'
).
createServer
(
app
);
var
server
=
app
.
listen
(
3001
,
function
(){
var
https
=
require
(
"
https
"
);
console
.
log
(
'
http listening on *:3001
'
);
});
// var http = require('http').createServer(app);
// var https = require("https");
var
axios
=
require
(
'
axios
'
);
var
axios
=
require
(
'
axios
'
);
var
io
=
require
(
'
socket.io
'
).
listen
(
server
);
// var io = require('socket.io')(http);
// var io = require('socket.io')(http);
let
fs
=
require
(
"
fs
"
);
//
let fs = require("fs");
// app.all('*', function(req, res, next) {
// app.all('*', function(req, res, next) {
...
@@ -42,11 +46,8 @@ app.get('/', function(req, res){
...
@@ -42,11 +46,8 @@ app.get('/', function(req, res){
res
.
send
(
'
<h1>Hello world</h1>
'
);
res
.
send
(
'
<h1>Hello world</h1>
'
);
});
});
http
.
listen
(
3001
,
function
(){
console
.
log
(
'
http listening on *:3001
'
);
});
var
io
=
require
(
'
socket.io
'
).
listen
(
http
);
//
var io = require('socket.io').listen(http);
io
.
on
(
'
connection
'
,
function
(
socket
){
io
.
on
(
'
connection
'
,
function
(
socket
){
console
.
log
(
"
connection
"
);
console
.
log
(
"
connection
"
);
...
@@ -127,6 +128,9 @@ io.on('connection', function(socket){
...
@@ -127,6 +128,9 @@ io.on('connection', function(socket){
});
});
// http.listen(3001, function(){
// console.log('http listening on *:3001');
// });
// https.createServer(httpsOption, app).listen(3000, function(){
// https.createServer(httpsOption, app).listen(3000, function(){
...
...
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