Sending correct cookie to XOS
Change-Id: I3414488ec634f05f6ff0c5b25cedc8df720e1896
diff --git a/spec/index.html b/spec/index.html
index 4f97749..c13b92f 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -2,7 +2,7 @@
<html>
<head>
<title>Socket.IO chat</title>
- <script src="http://10.1.8.44:3000/socket.io/socket.io.js"></script>
+ <script src="http://localhost:4000/socket.io/socket.io.js"></script>
<script
src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
@@ -14,41 +14,41 @@
max-width: 100%;
}
</style>
-<script>
- /* global io $ alert*/
- function enableSocket(auth) {
+ <script>
+ /* global io $ alert*/
+ function enableSocket(auth) {
- auth.user = JSON.parse(auth.user);
+ auth.user = JSON.parse(auth.user);
- var socket = io.connect('http://10.1.8.44:3000', {
- query: 'name=' + auth.user.username + '&token=' + auth.xoscsrftoken + '&sessionId=' + auth.xossessionid + '&id=' + auth.user.id
- });
- socket.on('event', function(data) {
- var p = $('body').append('<p></p>');
- p.append('<b>' + data.model + '</b><br/>');
- p.append('<i>' + JSON.stringify(data.msg.changed_fields) + '</i>');
- p.append('<pre>' + JSON.stringify(data.msg.object) + '</pre>');
- console.log(data.object);
- $.notify(data.model + ': ' + JSON.stringify(data.msg.object.name) + 'updated', 'success');
- });
- }
-
- function login() {
- var username = $('#username').val();
- var password = $('#password').val();
-
- $.get('http://10.1.8.44:3000/api/utility/login?username='+username+'&password='+password,
- function(res) {
- enableSocket(res);
- $('#login').hide();
+ var socket = io.connect('http://localhost:4000', {
+ query: 'name=' + auth.user.username + '&token=' + auth.xoscsrftoken + '&sessionId=' + auth.xossessionid + '&id=' + auth.user.id
+ });
+ socket.on('event', function(data) {
+ var p = $('body').append('<p></p>');
+ p.append('<b>' + data.model + '</b><br/>');
+ p.append('<i>' + JSON.stringify(data.msg.changed_fields) + '</i>');
+ p.append('<pre>' + JSON.stringify(data.msg.object) + '</pre>');
+ console.log(data.object);
+ $.notify(data.model + ': ' + JSON.stringify(data.msg.object.name) + 'updated', 'success');
+ });
}
- )
- .fail(function(e) {
- alert( 'error' );
- console.log(e);
- });
- }
-</script>
+
+ function login() {
+ var username = $('#username').val();
+ var password = $('#password').val();
+
+ $.get('http://localhost:4000/api/utility/login?username='+username+'&password='+password,
+ function(res) {
+ enableSocket(res);
+ $('#login').hide();
+ }
+ )
+ .fail(function(e) {
+ alert( 'error' );
+ console.log(e);
+ });
+ }
+ </script>
</head>
<body>
<form onsubmit="login()" id="login">