Fiddle with websocket for hosting on server

This commit is contained in:
Adam Goldsmith 2018-07-12 21:04:53 -04:00
parent 70dcdf5d4f
commit 790973cce2
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ function alertVoltage(callsign) {
`Voltage: ${stations[callsign].lastVoltage}`); `Voltage: ${stations[callsign].lastVoltage}`);
} }
let aprsStream = new WebSocket("ws://localhost:1234"); let aprsStream = new WebSocket("wss://adamgoldsmith.name/APRSws");
aprsStream.onmessage = function(event) { aprsStream.onmessage = function(event) {
let message = JSON.parse(event.data); let message = JSON.parse(event.data);
let callsign = `${message.from.call}-${message.from.ssid || 0}`; let callsign = `${message.from.call}-${message.from.ssid || 0}`;

View File

@ -4,7 +4,7 @@ let aprs = require("aprs-parser");
const parser = new aprs.APRSParser(); const parser = new aprs.APRSParser();
const client = new net.Socket(); const client = new net.Socket();
const wss = new WebSocket.Server({port: 1234}); const wss = new WebSocket.Server({host: "127.0.0.1", port: 1234});
wss.broadcast = function(data) { wss.broadcast = function(data) {
wss.clients.forEach(client => { wss.clients.forEach(client => {