- Server: https://github.com/websockets/ws#server-example
- Client: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
In the client JS console: socket.send("hi");
It'll log in the server and come back to the client with thanks.
In the client JS console: socket.send("hi");
It'll log in the server and come back to the client with thanks.
The rest_route
parameter allows one to pass the JSON API route directly to WordPress rather than using the /wp-json
base URL.
So: https://demo.wp-api.org/?rest_route=/wp/v2/posts vs https://demo.wp-api.org/wp-json/wp/v2/posts (which will 404 if you don't have a compatible permalink setup for your site).
Reference: