Best video on socket so far, i will never forget the flow of the socket, the UI sends some events the server listens for it and in turn, it itself sends some events which the UI server listens on and gets whatever server has sent. bro this is mind blowing how short you made it.
@skourt52092 жыл бұрын
I tried learning web sockets 10 months ago and quit, this video was clear and very helpful i understood it , thank you!
@bjrneileras25344 ай бұрын
extremely helpful for someone just getting into this stuff. Thank you!
@eusouonizuka6 ай бұрын
I need catch the URL from websocket, but how?
@karlembeast4 ай бұрын
Great tutorial on Websockets. I am trying to branch from this tutorial and use websockets to send files from the backend to the frontend. At the moment I have 3 distinct pdf files that I transfer using separate websockets. In the near future I'm planning to add more pdf files. To avoid creating N number of websockets for N number of pdf files, is there a better approach to manage all this?
@iamTLC2 жыл бұрын
I'd love to know how you handle WebSocket instances within a react environment. I have seen RTK users wrap the app in a WebSocket provider. However, I am creating an instance at the app level and passing this around to make requests. This I feel may not be the best way as the hot reload of react can start to play badly with the WebSocket instance :(
@WebDevCody2 жыл бұрын
I think it’s fine to just set it up higher up in the component tree and allow children to access the websocket instance to add listeners on mount or remove listeners on clean up. I’m curious how hot reload messes with it
@memeproductions41822 жыл бұрын
I personally use a Redux middleware with RTK to control the websocket connection in response to redux dispatched actions
@dailydoseofchocolate9411 Жыл бұрын
@@memeproductions4182 do you have repo with example of it?
@ucnguyen-jq4mh2 ай бұрын
Thank you this is really clear
@MohdDanish-i2h Жыл бұрын
websocket is not connected for first time but after that it is connecting. please help??
@anmoljhamb902411 ай бұрын
Hey! What would you recommend, for hosting the application? Because, I honestly can't find a good enough website that allows me to host it for free.
@WebDevCody11 ай бұрын
What’s your stack?
@anmoljhamb902411 ай бұрын
@@WebDevCody I honestly just want to host a simple express server with websockets support. It doesn't work on vercel. Heroku now requires a credit card which I don't have :/ glitch only gives away like certain free hours, but I have 3 or 4 different projects that I wanna host, which all use web sockets in some way.
@RatherBeCancelledThanHandled7 ай бұрын
@@anmoljhamb9024If I’m not mistaken you can convert your project to a docker image and run it on cloud run for very cheap (not free but inexpensive)
@techhubpk98362 ай бұрын
my server is created from http but my traffic is from https that causing error of connection on production. but on my local machine it is working fine
@tidakdiketahui5147Ай бұрын
Is your error solved? I seem to have the same problem
@anjalii11022 жыл бұрын
Can you also later do with server sent events too 🙂
@FlipFlip2 жыл бұрын
Can you do a tutorial on socket authentication/reconnection?
@mikehillbilly40794 ай бұрын
Excellent.
@tiherus2 жыл бұрын
what if the button will call an API. how can i access the socket on the controller?
@WebDevCody2 жыл бұрын
No sure what you mean
@tiherus2 жыл бұрын
@@WebDevCody at backend, the socket is always at index.js, what if I have a controller folder how can I access the socket there. frontend > api/ping > backend > route > controller > socket emit ping
@tiherus2 жыл бұрын
I mean at frontend, I wont be using socket to call the backend but I will be using an API call. Then at my backend that API call will return a socket emit. is it feasible?
@WebDevCody2 жыл бұрын
@@tiherus yeah but you’d need to include in the api request some type of id so the server can figure out who to emit to
@tiherus2 жыл бұрын
@@WebDevCody okay, thanks a lot!
@369-davian8 ай бұрын
can you made the same without localhost, I guess not. lol
@SeibertSwirl2 жыл бұрын
Good job baby love ❤️
@meekbronsen66687 ай бұрын
Men, how you gonna teach people to code with a cursor, CODE ALONG WITHT THEIM