I have a local react web app attempting to establish a WebSocket connection with this app engine instance. The web app uses
socket.io and initially defaults to polling HTTP requests. These requests all timeout-- I'm unable to establish a web socket connection. I'm not sure what might be causing my issue, whether it is my app engine configuration or my flask
socket.io setup.
Here is my initialization code for flask
socket.io:
app = Flask(__name__)
socketio = SocketIO(app)
socketio.init_app(app, cors_allowed_origins="*")
..
..
if __name__ == '__main__':
socketio.run(app, debug=True)
Here is my app.yaml:
runtime: python
env: flex
entrypoint: python3 server.py
runtime_config:
python_version: 3
manual_scaling:
instances: 1
network:
session_affinity: true
Here is the web app code attempting to set up the connection:
import io from 'socket.io-client'
const socketURL = "<app-engine-instance-url>:5000"
const socket = io.connect(socketURL)