Mastering WebSockets With Go - An in-depth tutorial

  Рет қаралды 52,279

ProgrammingPercy

ProgrammingPercy

Күн бұрын

Пікірлер: 76
@IvanRandomDude
@IvanRandomDude Жыл бұрын
Great time to watch the tutorial. Gorilla toolkit was archived for the past 8 months. But 2 days ago it became active again after new maintainers took over. No better time to watch this.
@Hibbert8
@Hibbert8 3 күн бұрын
Fantastic Tutorial. Thanks for taking the time to make this and share it. It really helps to see you go through and debug the project, rather than just copy/pasting code you have already tested.
@MonsterGames71
@MonsterGames71 Жыл бұрын
I would like to thank you for this amazing, detailed tutorial. This is exactly what I'm looking for. You're a lifesaver.
@programmingpercy
@programmingpercy Жыл бұрын
Thank you for letting me know you enjoyed it!
@YandryPozo
@YandryPozo 2 жыл бұрын
extremely well done and complete example, great job sir!
@programmingpercy
@programmingpercy 2 жыл бұрын
Thank you sir, glad you enjoyed
@percybolmer4343
@percybolmer4343 2 жыл бұрын
@@initialized glad you mentioned I my mic, I know it sucks! I am so happy to say that I have bought a Mic & Lightning ! Just trying to fix a virtual green screen or physical one! Thanks for mentioning it, so that I can improve
@dhaw
@dhaw Жыл бұрын
best golang ws chat tutorial, thanks a lot !!
@programmingpercy
@programmingpercy Жыл бұрын
Thank you for the kind words
@yegor3793
@yegor3793 Жыл бұрын
Hi I`m beginner in websockets and your video helped me to better undestand how to use gorilla building simple messengers.Your video is awesome!!
@programmingpercy
@programmingpercy Жыл бұрын
Thank you Yegor! Glad i could help
@July-dh9lk
@July-dh9lk 4 ай бұрын
Thank you! It's great. In two hours I've learned a lot. It's high quality course. I don't have much experience in coding, but I doubt I could have thought of some things on my own.
@paca3107
@paca3107 Жыл бұрын
thank you for this tutorial! I really appreciate that you invested your time to make this video.
@nasko235679
@nasko235679 3 ай бұрын
This is proof that all great coding videos are made by guys with 10$ webcams and 1$ microphones because they're too busy actually working, and most greatly produced content is made by influencers who don't really know what they're talking about.
@programmingpercy
@programmingpercy 3 ай бұрын
Wow those are some really nice words! Thanks!!!
@hellelo.5840
@hellelo.5840 2 ай бұрын
I couldn't like this video twice so I went and liked another video of yours😅
@jaypatel1393
@jaypatel1393 Жыл бұрын
This tutorial is awesome and explained so well - thanks
@programmingpercy
@programmingpercy Жыл бұрын
Big thanks for the kind words
@mahendranath2504
@mahendranath2504 Жыл бұрын
Wow ,Thank you so much for sharing the amazing content, liked 👍 and subscribed
@tokintmash
@tokintmash 4 ай бұрын
I think it's now like a sixth time I watch the "this is fairly fairly simple, I believe" part and finally I think I dare to move on. :D
@daicaphong84
@daicaphong84 Жыл бұрын
Amazing tutorial. Thank you
@PhilippeBazinet
@PhilippeBazinet 10 ай бұрын
This is a great tutorial, thanks you!
@boriskrasnov1672
@boriskrasnov1672 Жыл бұрын
I want to ask in what moment data insert to c.egress in ReadMessages 1:10:00?
@jxiongdevdiary
@jxiongdevdiary Жыл бұрын
Thanks for the step-by-step guide!
@pindi-zx4cs
@pindi-zx4cs 11 ай бұрын
Awesome work bro
@evanfang6573
@evanfang6573 2 жыл бұрын
Very clear. Very helpful.
@programmingpercy
@programmingpercy 2 жыл бұрын
Thank you for the kind words, thrilled to hear you enjoyed
@bjugdbjk
@bjugdbjk 2 жыл бұрын
Simply Fantastic, helps me a lot.i came here reading your medium post, Thanks a ton brother for the amazing content. I have a question though... I am building an Android game using kotlin in the front end and i am planning to choose Go at the backend and obviously I wil be using websockets, this video helped !!
@skl9942
@skl9942 10 ай бұрын
Awesome tutorial! I have one question, your pong/pong handling, from what I can tell its not doing anything if the client stops sending pongs back.
@dfdkjr8719
@dfdkjr8719 Жыл бұрын
When we say that Gorilla 'Connections only support one concurrent reader and one concurrent writer', does this mean that for *each* client connection we can only have one goroutine reading messages and one gorountine writing messages via a channel? Obviously, if we have multiple clients, there will be an equivalent number of reading and writing goroutines - but I assume this is not what the restriction is referring to?
@programmingpercy
@programmingpercy Жыл бұрын
Great question! To clarify, the gorilla connection is not safe to have concurrent writers. This is only true for writing, data into the connection. They have an example in their source code with a lot of comments that explains this if you'd like a more in depth explanation. So in short, we simply cannot spawn multiple goroutines that all tries to write on the same time. It might work at first glance, but there is a race risk going on. That's why we instead send messages on a Channel, and then send those one at a time. To prevent concurrent writes.
@baptisteleroyer3758
@baptisteleroyer3758 3 ай бұрын
thank you very much i learn a lot thank to your video
@notnull01
@notnull01 Жыл бұрын
Just what i was looking for, Thanks! is there a Part II? connecting to an external data storage (redis)?...
@programmingpercy
@programmingpercy Жыл бұрын
Hey! Hmm no part 2 planned. I do have an article on using Redis for PubSub, maybe I can update it Abit and Record that video. Only exists as text atm. programmingpercy.tech/blog/redis-as-a-pub-sub-engine-in-go/
@notnull01
@notnull01 Жыл бұрын
@@programmingpercy thanks 🙏 reading it right now
@nelsonbalmaceda7046
@nelsonbalmaceda7046 2 жыл бұрын
Great video and topic
@SvartAdamSolander
@SvartAdamSolander Жыл бұрын
Great tutorial! Looking forward your other tutorials! Too bad that your mic isn’t great. I think your content is so good that I would gladly swish 30-50 kr towards a new microphone. :)
@fouad-hachour9968
@fouad-hachour9968 Жыл бұрын
many thanks
@9ezi435
@9ezi435 Жыл бұрын
Hi, I want to use go to connect to the asterisk server.
@Flascoo
@Flascoo Жыл бұрын
Great video! Micro from DDD video was definetly better btw
@bjugdbjk
@bjugdbjk Жыл бұрын
Gorialla websocket is limiting to only 1 concurrent connection at a time, is this limitation only for Gorilla websocet or its same for other Go web libraries as well ?
@programmingpercy
@programmingpercy Жыл бұрын
I know that the x/net/websocket supports multiple, but that package is also deprecated and frozen. That package has trouble with defragmented frames tho. I can't speak for gobws since I haven't used them.
@programmingpercy
@programmingpercy Жыл бұрын
Let me make this clear, it's only limited to one concurrent WRITE, and this shouldn't pose an issue if implemented correctly, it scales pretty good. So I don't think many people have had an issue with that.
@shubhamverma572
@shubhamverma572 Жыл бұрын
Firstly Thanks and Nice explained !! BTW I have one question, how do we handle the web socket connections in Distributed system (like multiple instance are running for the same service)
@programmingpercy
@programmingpercy Жыл бұрын
Great question. At the point where you start running multiple instances, it is common to include Redis or RabbitMQ to allow distributed messages for the websockets. You would then listen on the PubSub schema used and push messages on RabbitMQ/Redis, then read from those topics and push onto the Websockets.
@shubhamverma572
@shubhamverma572 Жыл бұрын
@@programmingpercy thanks👍
@mr.mendez7094
@mr.mendez7094 Жыл бұрын
Thanks bro!, yau are the best!
@programmingpercy
@programmingpercy Жыл бұрын
Nah, you're the best!
@mr.mendez7094
@mr.mendez7094 Жыл бұрын
​@@programmingpercy BROOO two weeks developing for my company, and your tutorial was my handbook, you help us a lot with the structure of our system
@mr.mendez7094
@mr.mendez7094 Жыл бұрын
​@@programmingpercy I'm a junior developer well, i'm still studing this engineering, but you help me a lot!!, i made a CRUD with your tutorial, you are the best
@TheRj725
@TheRj725 Жыл бұрын
Thanks for this, learnt a lot! I just have one question, how would you structure rooms? I dont want to broadcast mesaages to every client, I just want to send message to clients in a group. One thing I was thinking to do something like `/ws/{room_id}` and then clients will automatically be in a group thenI dont have to do any special in my code to handle rooms. Is this a correct assumption? EDIT- Okay, I just tested this,. it doesn't work this way xD
@mikealejandro3938
@mikealejandro3938 Жыл бұрын
This is absolutely amazing, thanks nigga !!!
@micha9138
@micha9138 Жыл бұрын
Gorilla? It is deprecated.
@programmingpercy
@programmingpercy Жыл бұрын
Yeah! Video was made before that! I have in mind to create a new one but I haven't decided on which OS solution I like best amongst the others.
@michelemendel
@michelemendel Жыл бұрын
@@programmingpercy It's archived, but so what. It hasn't changed for many years, and it works. I wouldn't worry about using it.
@programmingpercy
@programmingpercy Жыл бұрын
It's just if there is any RFCs that gets out that might be scary.
@notnull01
@notnull01 Жыл бұрын
@@programmingpercy cant wait, this video got me to understand websockets in go
@IvanRandomDude
@IvanRandomDude Жыл бұрын
It is active again
@isaidspaghetti
@isaidspaghetti 2 ай бұрын
I can’t with the audio:(
@hiyoutube6769
@hiyoutube6769 Жыл бұрын
sound is sick but good presentation
@programmingpercy
@programmingpercy Жыл бұрын
I am making sure to fix the sound for future videos! Thanks!
@catalinim4227
@catalinim4227 Жыл бұрын
old stuff 🎉
@m_205
@m_205 Жыл бұрын
Gorilla is dead.
@programmingpercy
@programmingpercy Жыл бұрын
Actually that's not true www.reddit.com/r/golang/comments/1528e25/gorilla_web_toolkit_new_maintainers_announcement/? It's alive again
@m_205
@m_205 Жыл бұрын
Thanks brother, have a good day
@sahildhingraa
@sahildhingraa Жыл бұрын
didn't understand anything even after spending 3 days to watching this tutorial
@codeunited5905
@codeunited5905 Жыл бұрын
No way, man! It's not even that hard. You mustn't have coded along with the video. This video is a gem. I spend like a day watching this tutorial for my chat application and I guess I've implemented the websocket part of the application effectively. I implemented something similar after watching the video, an event based websocket system, but with slight differences. Instead of using OTP, I'm using JWT for authorization, MongoDB for storing user details and messages (I'm not using any message queues or stuff for now as it might add unwanted complexity to the program), and gin frame work to stick everything together. If you are not a video person, just read his blog. It's much easier to follow along. Also, try to understand the logic behind websockets and how to utilise it. Then implement it in your own way, which you will find is much easier to maintain the code base. Happy coding!
@sahildhingraa
@sahildhingraa Жыл бұрын
@@codeunited5905 no I was coding alongside the video but didn't understand anything. It's my personal opinion, no hate to you or your channel.
@programmingpercy
@programmingpercy Жыл бұрын
No worries man, no offense taken. It's really hard to create content that fits everybodies needs. One might find a tutorial progressing too fast whilst others find it way to slow. But if you don't mind me asking, what in particular made it hard for you to follow? Is it to fast? Would you like deeper explaining on what's going on? It would be great to know so I can improve future videos
@sahildhingraa
@sahildhingraa Жыл бұрын
@@programmingpercy I'm a beginner in golang, so most of the concepts were confusing for me
@varunzid123
@varunzid123 11 ай бұрын
Bruh The video shows at the beginning that he expects viewers to be ‘somewhat familiar with go’ You need to build your basics before you could reach the skill level for this video No hate is good, you better come back and rewatch after you progress
@tokintmash
@tokintmash 4 ай бұрын
Oh man, the way you're using Go routines and methods and structs... Struggling to keep up with everything :D
@SwarajSingh-xs6dy
@SwarajSingh-xs6dy Жыл бұрын
Man what do I use gorilla mux or socket io for golang ?
@programmingpercy
@programmingpercy Жыл бұрын
I like gorilla much, there was a bit trouble when the maintainer decided to archive it. But since then it has gotten a group of new maintainers and is in a good place. I'd stick with Gorilla,
Fuzzing In Go
27:28
ProgrammingPercy
Рет қаралды 3 М.
Concurrency in Go
18:40
Jake Wright
Рет қаралды 625 М.
"Идеальное" преступление
0:39
Кик Брейнс
Рет қаралды 1,4 МЛН
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
How To Build A Chat And Data Feed With WebSockets In Golang?
20:45
WebSockets Crash Course - Handshake, Use-cases, Pros & Cons and more
47:33
How to scale WebSockets to millions of connections
14:01
Ably Realtime
Рет қаралды 33 М.
How Web Sockets work | Deep Dive
10:22
ByteMonk
Рет қаралды 27 М.
Using RabbitMQ Steams In Go
1:33:18
ProgrammingPercy
Рет қаралды 2,9 М.
Projects Every Programmer Should Try
16:58
ThePrimeTime
Рет қаралды 549 М.
Learn RabbitMQ for Event-Driven Architecture (EDA)
2:21:01
ProgrammingPercy
Рет қаралды 13 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 328 М.
"Идеальное" преступление
0:39
Кик Брейнс
Рет қаралды 1,4 МЛН