Skip to content

Commit

Permalink
updated angular-websockets && is now working again
Browse files Browse the repository at this point in the history
  • Loading branch information
blackjack4494 committed Nov 26, 2018
1 parent 90f2f3d commit 22f512a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,21 @@ useful diagnostic tool while making changes to your own network configuration.

## Example

http://trace.hamwan.net/
~~http://trace.hamwan.net/~~

## Installation

```sh
sudo apt-get install mtr
sudo apt-get install mtr python python-pip
git clone https://github.com/kd7lxl/mtr-web.git
cd mtr-web
virtualenv env
source env/bin/activate
pip install Flask-Sockets gunicorn
```

## Usage

```sh
gunicorn -k flask_sockets.worker mtr-web:app
gunicorn -b 0.0.0.0 -k flask_sockets.worker mtr-web:app
```

http://127.0.0.1:8000
Expand Down
10 changes: 7 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</style>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="https://cdn.rawgit.com/gdi2290/angular-websocket/v1.0.8/angular-websocket.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
<script src="https://cdn.rawgit.com/AngularClass/angular-websocket/v2.0.0/dist/angular-websocket.min.js"></script>
<section ng-controller="SomeController">
<form class="form-inline" ng-submit="submit(hostname, protocol, version, dns)">
<table class="table table-very-condensed">
Expand Down Expand Up @@ -82,7 +82,11 @@
response[i] = [];
}

ws = $websocket('ws://127.0.0.1:8000/mtr');
var url = new URL(window.location.href);
url.protocol = url.protocol.replace('http', 'ws');
url.href = url.href + "mtr"
ws = $websocket(url.href);
//console.log("log: " + url.href);

ws.onMessage(function(message) {
var data = JSON.parse(message.data);
Expand Down

0 comments on commit 22f512a

Please sign in to comment.