tests: remove unused test app
This was disabled 12 years ago...
This commit is contained in:
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -323,13 +323,6 @@ updates:
|
|||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
labels:
|
labels:
|
||||||
- "type: dependencies"
|
- "type: dependencies"
|
||||||
- package-ecosystem: npm
|
|
||||||
directory: "/tests/apps/.websocket.disabled"
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
open-pull-requests-limit: 10
|
|
||||||
labels:
|
|
||||||
- "type: dependencies"
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
web: node app.js
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node websocket demo
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
var express = require('express')
|
|
||||||
, exphbs = require('express3-handlebars')
|
|
||||||
, http = require('http')
|
|
||||||
, connect = require('connect')
|
|
||||||
, io = require('socket.io');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var app = express();
|
|
||||||
|
|
||||||
app.engine('handlebars',exphbs({extname: ".html", layoutsDir:"views/", defaultLayout: 'layout'}));
|
|
||||||
app.set('view engine', 'handlebars');
|
|
||||||
/* NOTE: We'll need to refer to the sessionStore container later. To
|
|
||||||
* accomplish this, we'll create our own and pass it to Express
|
|
||||||
* rather than letting it create its own. */
|
|
||||||
var sessionStore = new connect.session.MemoryStore();
|
|
||||||
/* NOTE: We'll need the site secret later too, so let's factor it out.
|
|
||||||
* The security implications of this are left to the reader. */
|
|
||||||
var SITE_SECRET = 'I am not wearing any pants';
|
|
||||||
|
|
||||||
|
|
||||||
// app.configure(function(){
|
|
||||||
// app.set('view engine', 'handlebars');
|
|
||||||
// // app.set("view options", { layout: false })
|
|
||||||
// });
|
|
||||||
|
|
||||||
app.set('views', __dirname + '/views');
|
|
||||||
// app.register('.html', require('handlebars'));
|
|
||||||
/*
|
|
||||||
* ... skipping some of your app settings ...
|
|
||||||
*/
|
|
||||||
app.use(express.bodyParser());
|
|
||||||
/* NOTE: Pass the cookieParser the site secret. It used to be that
|
|
||||||
* express.session() got the secret, but in Express 3 that's
|
|
||||||
* no longer the case. */
|
|
||||||
app.use(express.cookieParser(SITE_SECRET));
|
|
||||||
/* NOTE: We'll need to know the key used to store the session, so
|
|
||||||
* we explicitly define what it should be. Also, we pass in
|
|
||||||
* our sessionStore container here. */
|
|
||||||
app.use(express.session({
|
|
||||||
key: 'express.sid'
|
|
||||||
, store: sessionStore
|
|
||||||
}));
|
|
||||||
|
|
||||||
app.use(express.static('public'));
|
|
||||||
/*
|
|
||||||
* ... skipping the rest of your app settings ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
app.get('/', function(req, res){
|
|
||||||
res.render('index', {socket_url:"ciaourl"});
|
|
||||||
});
|
|
||||||
|
|
||||||
var server = http.createServer(app);
|
|
||||||
|
|
||||||
var app_port = process.env.PORT || 3000;
|
|
||||||
server.listen(app_port, function(){
|
|
||||||
console.log("Express server listening on port "+ app_port);
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Socket.io
|
|
||||||
*/
|
|
||||||
var sio = io.listen(server);
|
|
||||||
|
|
||||||
|
|
||||||
sio.sockets.on('connection', function (socket) {
|
|
||||||
|
|
||||||
// temperature
|
|
||||||
setInterval(function () {
|
|
||||||
var val = (new Date).getTime();
|
|
||||||
socket.emit('new value', { val: "I'm a websocket message: "+val });
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
output="$(curl -s -S -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"
|
|
||||||
echo "$output"
|
|
||||||
test "$output" == "bazingaa"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "node-websocket-app",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"description": "a basic webscket demo",
|
|
||||||
"author": "Luigi Maselli",
|
|
||||||
"dependencies": {
|
|
||||||
"express": "5.1.x",
|
|
||||||
"connect": "*",
|
|
||||||
"handlebars": "~4.7.1",
|
|
||||||
"socket.io": "~4.8.0",
|
|
||||||
"express3-handlebars": "~0.5.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "0.10.x"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +0,0 @@
|
|||||||
<h2>I'm a static HTTP message</h2>
|
|
||||||
<h1 id="display">
|
|
||||||
No messages
|
|
||||||
</h1>
|
|
||||||
<p>If you get many GET messages in your console it isn't websocket but socket.io fallback mode</p>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Websocket demo Socket.io</title>
|
|
||||||
<script src="./socket.io/socket.io.js"></script>
|
|
||||||
<script src="./jquery.min.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
|
|
||||||
var socket = io.connect( window.location.origin ); // transparent HTTP / Websocket upgrade
|
|
||||||
|
|
||||||
socket.on('new value', function (data) {
|
|
||||||
console.log("RECV:"+ JSON.stringify(data));
|
|
||||||
$('#display').html(data.val);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
{{{body}}}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user