How I like to setup websockets in my web applications

  Рет қаралды 50,077

Web Dev Cody

Web Dev Cody

Күн бұрын

Пікірлер: 31
@xen0076
@xen0076 Жыл бұрын
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.
@skourt5209
@skourt5209 2 жыл бұрын
I tried learning web sockets 10 months ago and quit, this video was clear and very helpful i understood it , thank you!
@bjrneileras2534
@bjrneileras2534 4 ай бұрын
extremely helpful for someone just getting into this stuff. Thank you!
@eusouonizuka
@eusouonizuka 6 ай бұрын
I need catch the URL from websocket, but how?
@karlembeast
@karlembeast 4 ай бұрын
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?
@iamTLC
@iamTLC 2 жыл бұрын
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 :(
@WebDevCody
@WebDevCody 2 жыл бұрын
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
@memeproductions4182
@memeproductions4182 2 жыл бұрын
I personally use a Redux middleware with RTK to control the websocket connection in response to redux dispatched actions
@dailydoseofchocolate9411
@dailydoseofchocolate9411 Жыл бұрын
@@memeproductions4182 do you have repo with example of it?
@ucnguyen-jq4mh
@ucnguyen-jq4mh 2 ай бұрын
Thank you this is really clear
@MohdDanish-i2h
@MohdDanish-i2h Жыл бұрын
websocket is not connected for first time but after that it is connecting. please help??
@anmoljhamb9024
@anmoljhamb9024 11 ай бұрын
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.
@WebDevCody
@WebDevCody 11 ай бұрын
What’s your stack?
@anmoljhamb9024
@anmoljhamb9024 11 ай бұрын
@@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.
@RatherBeCancelledThanHandled
@RatherBeCancelledThanHandled 7 ай бұрын
@@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)
@techhubpk9836
@techhubpk9836 2 ай бұрын
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
@tidakdiketahui5147 Ай бұрын
Is your error solved? I seem to have the same problem
@anjalii1102
@anjalii1102 2 жыл бұрын
Can you also later do with server sent events too 🙂
@FlipFlip
@FlipFlip 2 жыл бұрын
Can you do a tutorial on socket authentication/reconnection?
@mikehillbilly4079
@mikehillbilly4079 4 ай бұрын
Excellent.
@tiherus
@tiherus 2 жыл бұрын
what if the button will call an API. how can i access the socket on the controller?
@WebDevCody
@WebDevCody 2 жыл бұрын
No sure what you mean
@tiherus
@tiherus 2 жыл бұрын
@@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
@tiherus
@tiherus 2 жыл бұрын
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?
@WebDevCody
@WebDevCody 2 жыл бұрын
@@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
@tiherus
@tiherus 2 жыл бұрын
@@WebDevCody okay, thanks a lot!
@369-davian
@369-davian 8 ай бұрын
can you made the same without localhost, I guess not. lol
@SeibertSwirl
@SeibertSwirl 2 жыл бұрын
Good job baby love ❤️
@meekbronsen6668
@meekbronsen6668 7 ай бұрын
Men, how you gonna teach people to code with a cursor, CODE ALONG WITHT THEIM
How to scale WebSockets to millions of connections
14:01
Ably Realtime
Рет қаралды 33 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 327 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
WebSockets in 100 Seconds & Beyond with Socket.io
8:31
Fireship
Рет қаралды 1 МЛН
Real-Time Push Notifications with Socket.IO | React & Node.js Tutorial
16:20
How To Debug React Apps Like A Senior Developer
21:07
Web Dev Simplified
Рет қаралды 187 М.
20 months developing a web server in C
10:59
Roy Salazar
Рет қаралды 6 М.
Realtime Features for React: Easier Than You Think
14:58
Josh tried coding
Рет қаралды 64 М.
How-To Build Web Apps with AI for Beginners (Free)
28:49
The AI Advantage
Рет қаралды 32 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 355 М.
I built a REAL Desktop App with both Tauri and Electron
12:22
Bufferhead
Рет қаралды 92 М.
Websockets in NestJs (Real-Time Chat App)
24:51
Computerix
Рет қаралды 10 М.
How to use WebSockets - JavaScript Tutorial For Beginners
13:49