openai/openai-realtime-console

Unable to connect to relay server: Could not connect to "http://localhost:8081"

Opened this issue · 1 comments

I start my relay server using npm run relay:

 [nodemon] starting `node ./relay-server/index.js`
[RealtimeRelay] Listening on ws://localhost:8081

I edit my .env:

OPENAI_API_KEY=<MY_API_KEY>
REACT_APP_LOCAL_RELAY_SERVER_URL=http://localhost:8081

Then I launch react using npm start. When I click connect the browser errors out with:

Could not connect to "http://localhost:8081"
    at WebSocket.connectionErrorHandler (http://localhost:3000/static/js/bundle.js:59606:18)

You need to first run npm run relay to start the relay server. (Leave that running in another shell, before you run npm start)