screenshot-to-code icon indicating copy to clipboard operation
screenshot-to-code copied to clipboard

have to wss ?

Open ituserxxx opened this issue 1 year ago • 2 comments

Error reading filesSecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

ituserxxx avatar Dec 13 '23 02:12 ituserxxx

Where are you getting this error? You shouldn't be doing wss if you're running this locally.

abi avatar Dec 13 '23 02:12 abi

I started running directly in github's codespaces, using docker compose,You can go directly to https://curly-fortnight-vwqv456759p36xwj-5173.app.github.dev/

ituserxxx avatar Dec 13 '23 02:12 ituserxxx

“I am using it on the server, so I also encountered this problem. How can I solve it?” index-0b095b1d.js:225 Mixed Content: The page at 'https://XXX.XXX.XXX/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://stc.wenqian.space/generate-code'. This request has been blocked; this endpoint must be available over WSS.

etfromchina avatar Jan 18 '24 08:01 etfromchina

@etfromchina you need to configure the environment variable in the frontend/.env.local

VITE_WS_BACKEND_URL=wss://stc.wenqian.space

robdex avatar Jan 18 '24 08:01 robdex

Closing this since the solutions suggested above should work for people.

abi avatar Jan 18 '24 16:01 abi