Skip to content

Commit

Permalink
fix: hostname with prototcol for domain names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Bentley authored and Tony Bentley committed Jan 3, 2024
1 parent 4e6fba7 commit a6a68ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ import * as nmea from 'nmea-simple';
import './App.css';


const location = window.location.host;
const getData = async () => {
const res = await fetch(`${window.location.host}/skServer/eventsRoutingData`);
const res = await fetch(`http://${location}/skServer/eventsRoutingData`);
return await res.json();
}

Expand Down Expand Up @@ -171,7 +172,7 @@ function App() {
const updateSocketEvents = useCallback(() => {
const checkedVisibleEvents = events.filter((event: EEListItem) => event.checked === true && event.visible === true)
const eventList = checkedVisibleEvents.map(event => event.value).join(',');
const socketAddress = `ws:${window.location.host}/signalk/v1/stream?events=${eventList}&subscribe=none`;
const socketAddress = `ws:${location}/signalk/v1/stream?events=${eventList}&subscribe=none`;
if(checkedVisibleEvents.length > 0){
socketConnection.current?.close();
const socket = new WebSocket(socketAddress);
Expand Down

0 comments on commit a6a68ab

Please sign in to comment.