Hi everyone,
I wanted to share some exciting news — OpenAI recently released its first API that allows live chat, and it opens up amazing possibilities for WordPress integration. However, there’s a challenge: client-side connections (i.e., JS on the front end) directly to OpenAI come with significant risks, primarily exposing API keys. While it might work for testing purposes, exposing those keys isn’t a sustainable solution.
The answer here is to use a WebSocket proxy hosted on the server-side, enabling secure, real-time communication without exposing sensitive data. I’m not asking specifically about building a WebSocket proxy, but rather about implementing WebSockets as a server on Local.
The idea would be to pick a PHP file in the Local environment, which would then act as a WebSocket server. This would allow us to implement a WebSocket service and call it directly from our local development environment. I know WebSockets work as a client on Local, but enabling them as a server would make all the difference.
This is going to be a critical feature that many will want very soon. I’m the developer behind AI Engine (AI Engine – WordPress plugin | WordPress.org), and I can confidently say this will be one of the most requested features in the near future. While it’s likely that this will become standard in a year or two, having this functionality in Local now would give developers a head start.
Thanks so much for considering this. It would be a game-changer!