Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
@Thrackerzod112 жыл бұрын
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 {...}
@angelhdzdev2 жыл бұрын
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.
@angelhdzdev2 жыл бұрын
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...
@jagendrasrivastava226310 ай бұрын
Thanks It works. !!!!!
@wer2young2die4 ай бұрын
@@jagendrasrivastava2263 cors: { origin: 'null', } worked for me
@abdurrehman6613 жыл бұрын
Postman can also be used to test web sockets if someone do not want to make client part for testing
@karasira2696Ай бұрын
thanks, that's good to know
@ayoubguismi45583 жыл бұрын
Thank again michael guaw, as always very simple and well explained
@OleksandrDanylchenko2k3 жыл бұрын
Solid basic example, thanks!
@mohabedr50303 жыл бұрын
but this is not socket io library this is websockets
@jpeiter3 жыл бұрын
very useful, straight to the point!
@berkcansavur9035 Жыл бұрын
Great simple explaination and suggestive for improving the understand of concept.
@kosmedsuporte2 жыл бұрын
Thanks for the content !! Which theme are u using ?
@brightbong92 Жыл бұрын
if you to occur cors error add @WebSocketGateway(port, {cors: '*'} )
@lttungitbe07072 Жыл бұрын
Thank you so much
@tulionavarro65433 жыл бұрын
Beautiful way to explain, tks!!
@shehanrangana1844 Жыл бұрын
Solid simple example. Thanks
@panthpatel306611 ай бұрын
Is it possible to create many different socket channels, e.g. for group chat, so only the relevant clients can see their group chats?
@arashalfoneh28272 жыл бұрын
Thank you for recording this video
@АлександрЕлагин-м2ю3 жыл бұрын
Cool example, what about testing socket on nestjs?
@abdelazizelhayyany6087 Жыл бұрын
12:24 dd hh hahaha real tests
@watchyour203 жыл бұрын
Awesome video! Thanks!
@xice1113 жыл бұрын
i have a CORS problem, any solution?
@midblep3 жыл бұрын
Make sure you have your nestjs server turned on, that was my problem!
@mguay3 жыл бұрын
Hi, what is the error you are recieving? Which browser are you using?
@PasNini73 жыл бұрын
@@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
@thevamsi3 жыл бұрын
@@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.97683 жыл бұрын
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)
@alexandervashchuk779510 ай бұрын
incompatible with the latest versions of nestjs cors issues are not fixable
@MadanLal-ue1gr2 жыл бұрын
video anda sangat bagus dan mempunyai mesej yang luas terima kasih
@safaltammewar42333 жыл бұрын
How to run WebSocket with HTTPS in nestjs
@lilililliilil2 жыл бұрын
Great video ty❤
@amitmondal74273 жыл бұрын
Thank you ❤❤❤
@amitmondal74273 жыл бұрын
@Maxim Lian I have no extra time to watch movies, thank.
@irhasm.a.4932 Жыл бұрын
please make more💙
@muzafferckay26093 жыл бұрын
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.
@mguay3 жыл бұрын
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.
@muzafferckay26093 жыл бұрын
@@mguay My client is build in react. I could not figure out that.
@Voldeblort3 жыл бұрын
@@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.