Skip to content

Commit

Permalink
having ws use localhost instead of loopback (#46)
Browse files Browse the repository at this point in the history
Frontend failed to connect to websocket on backend on deploy because
neglected to update ws config to use localhost now that frontend is
static content in backend server app.
  • Loading branch information
krachwal authored May 17, 2024
2 parents d361f2a + bb06072 commit 28c352c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions react-frontend/src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PostBody {
i: number;
precision?: number;
}

function Form() {
const [iterationCount, setIterationCount] = useState(1000);
const [numeratorIsValid, setNumeratorValidity] = useState(false);
Expand Down Expand Up @@ -65,14 +65,14 @@ function Form() {

const isolateSymbol = () => {
return polynomialA.match(/([a-zA-Z])/)?.[0] ?? polynomialB.match(/([a-zA-Z])/)?.[0] ?? '';
}
};

const submit = (e: any) => {
e.preventDefault();
setWaitingForResponse(true);
setNoConvergence(false);

let websocket = new WebSocket('ws://127.0.0.1:80/data');
let websocket = new WebSocket('ws://localhost/data');

websocket.onopen = () => {
console.log('socket connection opened');
Expand Down

0 comments on commit 28c352c

Please sign in to comment.