Chat App With Nest.js + Socket.io in 15 Minutes

  Рет қаралды 74,984

Michael Guay

Michael Guay

Күн бұрын

Пікірлер: 50
@mguay
@mguay 11 ай бұрын
Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
@Thrackerzod11
@Thrackerzod11 2 жыл бұрын
Thank you for the video! I managed to get it up and running, though those following this guide nowadays may encounter a 400 response code with code 5: unsupported protocol version message. The solution is this: leave client-side code as it is, and decorate the ChatGateway class with the following options: @WebSocketGateway({ cors: { origin: '', methods: ['GET', 'POST'], transports: ['websocket', 'polling'], credentials: true, }, allowEIO3: true, }) export class ChatGateway {...}
@angelhdzdev
@angelhdzdev 2 жыл бұрын
Life saver! Thank you! I noticed I liked this video before that means I tried this solution before, but it didn't work this time! Gateway was receiving nothing, and frontend was throwing Cors error, even though I had the origin: ''. Added the other stuff and it worked right away! Thank you very much!!! Happy new year, wishing you health, joy and success.
@angelhdzdev
@angelhdzdev 2 жыл бұрын
Update: I deleted all the options except cors: { origin: 'localhost:9000', } And it's still working. I'm now confused because that's exactly what I had in the first place and didn't work...
@jagendrasrivastava2263
@jagendrasrivastava2263 10 ай бұрын
Thanks It works. !!!!!
@wer2young2die
@wer2young2die 4 ай бұрын
@@jagendrasrivastava2263 cors: { origin: 'null', } worked for me
@abdurrehman661
@abdurrehman661 3 жыл бұрын
Postman can also be used to test web sockets if someone do not want to make client part for testing
@karasira2696
@karasira2696 Ай бұрын
thanks, that's good to know
@ayoubguismi4558
@ayoubguismi4558 3 жыл бұрын
Thank again michael guaw, as always very simple and well explained
@OleksandrDanylchenko2k
@OleksandrDanylchenko2k 3 жыл бұрын
Solid basic example, thanks!
@mohabedr5030
@mohabedr5030 3 жыл бұрын
but this is not socket io library this is websockets
@jpeiter
@jpeiter 3 жыл бұрын
very useful, straight to the point!
@berkcansavur9035
@berkcansavur9035 Жыл бұрын
Great simple explaination and suggestive for improving the understand of concept.
@kosmedsuporte
@kosmedsuporte 2 жыл бұрын
Thanks for the content !! Which theme are u using ?
@brightbong92
@brightbong92 Жыл бұрын
if you to occur cors error add @WebSocketGateway(port, {cors: '*'} )
@lttungitbe07072
@lttungitbe07072 Жыл бұрын
Thank you so much
@tulionavarro6543
@tulionavarro6543 3 жыл бұрын
Beautiful way to explain, tks!!
@shehanrangana1844
@shehanrangana1844 Жыл бұрын
Solid simple example. Thanks
@panthpatel3066
@panthpatel3066 11 ай бұрын
Is it possible to create many different socket channels, e.g. for group chat, so only the relevant clients can see their group chats?
@arashalfoneh2827
@arashalfoneh2827 2 жыл бұрын
Thank you for recording this video
@АлександрЕлагин-м2ю
@АлександрЕлагин-м2ю 3 жыл бұрын
Cool example, what about testing socket on nestjs?
@abdelazizelhayyany6087
@abdelazizelhayyany6087 Жыл бұрын
12:24 dd hh hahaha real tests
@watchyour20
@watchyour20 3 жыл бұрын
Awesome video! Thanks!
@xice111
@xice111 3 жыл бұрын
i have a CORS problem, any solution?
@midblep
@midblep 3 жыл бұрын
Make sure you have your nestjs server turned on, that was my problem!
@mguay
@mguay 3 жыл бұрын
Hi, what is the error you are recieving? Which browser are you using?
@PasNini7
@PasNini7 3 жыл бұрын
@@mguay I have the same issue my error is index.html:1 Access to XMLHttpRequest at 'localhost:3000/socket.io/?EIO=3&transport=polling&t=Ng2pvch' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource., and I use google chrome
@thevamsi
@thevamsi 3 жыл бұрын
@@mguay Hey Michael. I have the same issue running this on google chrome. And I did add the app.enableCors() in main.ts which helped me get to my REST calls. For some reason, Can't get the ws to work properly.
@ziggys.9768
@ziggys.9768 3 жыл бұрын
Me too, maybe is a version problem. I have installed @nestjs/platform-socket.io": "^8.0.6" Firefox is my browser (and my server is turned on)
@alexandervashchuk7795
@alexandervashchuk7795 10 ай бұрын
incompatible with the latest versions of nestjs cors issues are not fixable
@MadanLal-ue1gr
@MadanLal-ue1gr 2 жыл бұрын
video anda sangat bagus dan mempunyai mesej yang luas terima kasih
@safaltammewar4233
@safaltammewar4233 3 жыл бұрын
How to run WebSocket with HTTPS in nestjs
@lilililliilil
@lilililliilil 2 жыл бұрын
Great video ty❤
@amitmondal7427
@amitmondal7427 3 жыл бұрын
Thank you ❤❤❤
@amitmondal7427
@amitmondal7427 3 жыл бұрын
@Maxim Lian I have no extra time to watch movies, thank.
@irhasm.a.4932
@irhasm.a.4932 Жыл бұрын
please make more💙
@muzafferckay2609
@muzafferckay2609 3 жыл бұрын
Could you make a tutorial using socket in rest api? For example when when data posted send the same data to the client main Page.
@mguay
@mguay 3 жыл бұрын
You can inject the Socket Gateway into any other service. So after you do something with data, you can tell the Gateway to emit a message to all subscribers.
@muzafferckay2609
@muzafferckay2609 3 жыл бұрын
@@mguay My client is build in react. I could not figure out that.
@Voldeblort
@Voldeblort 3 жыл бұрын
​@@muzafferckay2609 Correct me if im wrong but imo, it has nothing to do with your client application and the technology you choosed. At least it shouldn't be.
@Kareszrk
@Kareszrk 2 жыл бұрын
Thank you so much
@widya2550
@widya2550 Жыл бұрын
Superb
@quikseva5766
@quikseva5766 3 жыл бұрын
you must increase front size
@ekopurnomo9221
@ekopurnomo9221 Жыл бұрын
thankyouuu
@walkingtalkingstephenhawki8702
@walkingtalkingstephenhawki8702 Жыл бұрын
Gonna need to borrow that spelling, sorry.
@adeelshekhani636
@adeelshekhani636 3 жыл бұрын
I event got it working within 5mins
Websockets in NestJs (Real-Time Chat App)
24:51
Computerix
Рет қаралды 11 М.
Socket.io + ReactJS Tutorial | Learn Socket.io For Beginners
32:35
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Nest.js Caching Tutorial in 15 Minutes (Redis + Unit Testing)
13:00
NestJS Websockets Tutorial #1 - Creating a Websocket Gateway Server
20:37
Anson the Developer
Рет қаралды 63 М.
Best of CES 2025
14:50
The Verge
Рет қаралды 637 М.
Learn Socket.io In 30 Minutes
27:27
Web Dev Simplified
Рет қаралды 528 М.
'OXYGEN LEAK!'' Elon Musk Revealed WHY Starship Flight 7 Exploded...
11:01
Nest.js Microservices Tutorial in 20 Minutes
17:56
Michael Guay
Рет қаралды 115 М.
WebSockets in 100 Seconds & Beyond with Socket.io
8:31
Fireship
Рет қаралды 1 МЛН
Nestjs - быстрый курс по лучшему  Node js фреймворку
52:33
PurpleSchool | Anton Larichev
Рет қаралды 66 М.
Easiest way to build real-time web apps? WEBSOCKETS with NestJS
38:24
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН