How To Build A Chat And Data Feed With WebSockets In Golang?

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 90

  • @anthonygg_
    @anthonygg_  2 ปีที่แล้ว +3

    ► Join my Discord community for free education 👉 discord.com/invite/bDy8t4b3Rz
    ► Become a Patreon for exclusive tutorials👉 www.patreon.com/anthonygg_
    ► Buy me a coffee 👉 donate.stripe.com/aEU2a6ayH2uCa3u4gg
    Thanks for watching

  • @Browsinghard
    @Browsinghard 10 หลายเดือนก่อน +17

    Love that you go in showing the concepts without a bunch of libraries. Keep it simple and then abstract later if needed!

  • @nefrace
    @nefrace 2 ปีที่แล้ว +18

    You've just single handedly motivated me to learn Golang more than I usually did.
    This series of tutorials are awesome and I really appreciate this simplicity and minimalism of using standard libraries as much as possible.

    • @anthonygg_
      @anthonygg_  2 ปีที่แล้ว +2

      Happy I could motivate you 🎉

    • @viral-vector
      @viral-vector 11 หลายเดือนก่อน

      😅😅😅lllleere2le

  • @dranon0o
    @dranon0o ปีที่แล้ว +4

    One thing I love about your videos is that you're going right to the point

    • @anthonygg_
      @anthonygg_  ปีที่แล้ว +2

      Life is short. No time to waste. Margaritas are waiting.

  • @chips4real1
    @chips4real1 2 ปีที่แล้ว +45

    this channel is hidden gold

  • @manofqwerty
    @manofqwerty ปีที่แล้ว +2

    I have never looked into sockets and always thought they would be really complicated - thanks for this!

  • @VitaminessBlues
    @VitaminessBlues ปีที่แล้ว +3

    Like your style! Speed of speech and simplicity of explanation make it lit! Awesome!

  • @IkraamDev
    @IkraamDev 2 ปีที่แล้ว +1

    This channel is a gold mine.

  • @jacobusburger
    @jacobusburger 2 ปีที่แล้ว +1

    I don’t know Go but I don’t need to. I learned so much from this video, thank you!

  • @matthewthomas7645
    @matthewthomas7645 ปีที่แล้ว +1

    All great videos and not just that your a very funny chap, which makes the videos more relatible then someone just saying do this and that. Keep it up!

  • @letung6189
    @letung6189 3 หลายเดือนก่อน

    I have just visited your channel. After watching the videos, I have to say I feel like everything is very simple. We can do it. Just open vscode and write the stuff. ezpz like you said. LOL
    btw, I like the way you show the concept instead of using a lib and then say "ezpz".
    You let me know the core not only the implementation. Now I can do it in many languages which I know

  • @ribarmilos
    @ribarmilos ปีที่แล้ว +1

    You have a new subscriber. Thanks Anthony!

  • @crisgomez3282
    @crisgomez3282 ปีที่แล้ว +1

    oh thank you very much for making this tutorial, I had been looking for a good one, and you explain it quite well, and the best thing taught by Jhony sins

    • @anthonygg_
      @anthonygg_  ปีที่แล้ว +6

      Im also a fireman, plumber, and police office. Hide your girls.

  • @gadgetboyplaysmc
    @gadgetboyplaysmc ปีที่แล้ว +1

    I have subscribed. You make it look easy. I have no idea how it works because I come from TypeScript. The function syntax sort of is a little new to me. The map, create whatever is also all new to me. But will be studying this code. Thanks for this. Hope you make more useful content! Thanks!

  • @tpotjj2979
    @tpotjj2979 2 ปีที่แล้ว +3

    Netflix for Software Developers, proven content creator!

  • @sweetphilly2
    @sweetphilly2 ปีที่แล้ว +1

    Great tutorial. A bit fast for my liking but it gave me good insights. Would've like to see a thread-safe implementation of the connection map, but I'll research that on my own

  • @raspberrysans5880
    @raspberrysans5880 ปีที่แล้ว

    but REALLY you SHOULD get the Nobel Simplification Prize bc you explained so well! Thank you, sir :)

  • @sheikhAbdelrahman
    @sheikhAbdelrahman 5 หลายเดือนก่อน +1

    Great tutorial video Anthony :)
    I like your accent a lot .. where are you from mate :)?

  • @imranalperen
    @imranalperen หลายเดือนก่อน

    damn you right, need a nobel prize for simplifaction

  • @sovrinfo
    @sovrinfo 2 ปีที่แล้ว +1

    Great video. Big Thanks!

  • @dtuckrez
    @dtuckrez ปีที่แล้ว +1

    So helpful, thank you. 10/10

  • @elatronion
    @elatronion 2 หลายเดือนก่อน +1

    8:25 - My "Holy Grail port" is 7777. I call it my "jackpot" port! lol

  • @maaikevreugdemaker9210
    @maaikevreugdemaker9210 24 วันที่ผ่านมา

    Nobel prize for simplification should be a thing lol!!

  • @holgerm420
    @holgerm420 2 ปีที่แล้ว +2

    appreciate the zoom

  • @lebonbauma4167
    @lebonbauma4167 2 ปีที่แล้ว +1

    Amazing Stuff, Let's Go😎

  • @tokintmash
    @tokintmash 4 หลายเดือนก่อน

    So, do I understand correctly that if I want to have a list of online users, then, rather than having a database table for those, it makes more sense to use a feed and broadcast the list there? As DB is for stuff that needs to be accessed later and if I don't have to log who has been online, then I don't need to put it in the database?

  • @LeetCodeUzbekistan
    @LeetCodeUzbekistan 7 หลายเดือนก่อน +1

    Bro you doing great

  • @I_SEE_RED
    @I_SEE_RED 10 หลายเดือนก่อน +1

    Thank you Anthony

    • @anthonygg_
      @anthonygg_  10 หลายเดือนก่อน

      Thank you for being here

  • @puttenicole
    @puttenicole 2 ปีที่แล้ว +1

    Good stuff!

  • @tokintmash
    @tokintmash 4 หลายเดือนก่อน

    "böfr a'la sörverr" :D
    Great tutorial! I got write errors in the terminal when sending chat messages but these went away when I changed the port number. Was the port in use perhaps? Chat itself was functioning

  • @jhem
    @jhem 2 ปีที่แล้ว

    You can't fool me Johnny Sins, you typed something else at 2:06

  • @Cryoxia
    @Cryoxia ปีที่แล้ว

    Could anyone tell me where you get info on the errors returned by library methods? In the video, he talks about Conn.Write returning EOF, but I can't seem to find the info on the golang site

  • @AssyrianMuscle
    @AssyrianMuscle 2 ปีที่แล้ว +2

    Brother can we get some architecture style vids? Or your opinions on them (hex, clean) or even ddd in golang? Maybe some design patterns that you think work well specifically with go?

    • @anthonygg_
      @anthonygg_  2 ปีที่แล้ว +2

      I will make one next week.

    • @AssyrianMuscle
      @AssyrianMuscle 2 ปีที่แล้ว

      Honestly man you’re killing it, will be looking into contributing to your patreon this week!

  • @khoantranquang9277
    @khoantranquang9277 4 หลายเดือนก่อน

    When connecting to a Socket, do I need to download any libraries?

  • @TheNickeHallgren
    @TheNickeHallgren ปีที่แล้ว +1

    Excellent tutorial! How do I remove clients that have disconnected, as now they are still on the conns map after disconnecting and the next broadcast gives an error for use of closed network connection?

    • @TheNickeHallgren
      @TheNickeHallgren ปีที่แล้ว +2

      I answer my own question, in fuction readLoop add delete(s.conns, ws) before break in if err == io.EOF to delete disconnected clients :)

  • @sumonsutrodhar1495
    @sumonsutrodhar1495 ปีที่แล้ว

    Coould you please introduce tuntap packet reception and transmission for user space programs? TIA

  • @tanko.reactions176
    @tanko.reactions176 ปีที่แล้ว

    there is a subtle bug, will take you hours to find it if you dont know whats happening underneath..
    basically, you are not guaranteed that your messages come unchopped!
    just implement a message terminator and read until you encounter a message terminator, which may require 5 reads, for example and once you have all the fragments of 1 message, you can process the message! otherwise its incomplete, probably not a big issue in a chat app, but very problematic when you are transferring structured data!

  • @michelemendel
    @michelemendel ปีที่แล้ว +1

    Again, very nice. Could the actor model (e.g. your Hollywood library) be used with websockets, or would it be unnecessary?

    • @anthonygg_
      @anthonygg_  ปีที่แล้ว +1

      Tonights stream covers this

  • @yirgacc3931
    @yirgacc3931 ปีที่แล้ว

    very awesome tutorial GG, but i may have some problems with the websocket Write() method. Since I do it step by step with your video(just SAME as your code), i can't figure out that why the server can't write to the browser, no matter the first /ws or the later /orderbookfeed, it turns out the console don't print the message from the server after setting up the onmessage method, what's wrong?🥺

  • @zhiweizhang-ih8zv
    @zhiweizhang-ih8zv ปีที่แล้ว +1

    thanks for the sharing

  • @nagkanya
    @nagkanya ปีที่แล้ว

    Awesome stuff

  • @abdullahbiyik1342
    @abdullahbiyik1342 ปีที่แล้ว +1

    He can easily make joke about high-end industry topics, as he has full control over the topics.

  • @EMRAN994
    @EMRAN994 2 หลายเดือนก่อน

    great video

  • @jsmx2673
    @jsmx2673 ปีที่แล้ว +1

    hello. this video is very good. how to create tcp socket chat client / server custom protocol

  • @brendanortiz1742
    @brendanortiz1742 10 หลายเดือนก่อน +1

    your furiously fast typing + all the mistakes == me every time i know what i am actually trying to do my heart when i'm programming and just trying to do it fast af lol. When i don't know what i'm doing by heart i make 0 mistakes

  • @Ihavcat
    @Ihavcat ปีที่แล้ว

    This video made me feel old 😂

  • @90n1n74
    @90n1n74 2 ปีที่แล้ว +1

    Fantastic

  • @arielsashcov99
    @arielsashcov99 2 ปีที่แล้ว +1

    Didn't know Johnny Sins is into coding

    • @anthonygg_
      @anthonygg_  2 ปีที่แล้ว +3

      Im also an astronaut, fireman, and plumber. Hide your girls everyone.

  • @alexandrecolautoneto7374
    @alexandrecolautoneto7374 8 หลายเดือนก่อน

    GG, I appriciate when you care about the blind homies. 🤓

  • @BehzadBluekian
    @BehzadBluekian 3 หลายเดือนก่อน

    it is amazing

  • @kirindev
    @kirindev 8 หลายเดือนก่อน

    thank you.

  • @caskka
    @caskka 5 หลายเดือนก่อน

    LOVE U

  • @sorooshmoghimi5494
    @sorooshmoghimi5494 ปีที่แล้ว

    awesome

  • @tlobatowasd
    @tlobatowasd 8 หลายเดือนก่อน

    respect

  • @gokul1630
    @gokul1630 ปีที่แล้ว +1

    I was searching for silver & found gold

    • @anthonygg_
      @anthonygg_  ปีที่แล้ว +1

      Spread the word my man ❤️

  • @randomness3231
    @randomness3231 ปีที่แล้ว +1

    my Holy Grail port: 81

  • @CodeOnBlocks
    @CodeOnBlocks 10 หลายเดือนก่อน

    lmao the 1337 😂

  • @Saphintosh
    @Saphintosh 7 หลายเดือนก่อน

    Oh yeah, a golang websockets online class with johnny sins.

  • @tudorminciunescu9614
    @tudorminciunescu9614 ปีที่แล้ว

    code link ?

  • @MarsMan2482
    @MarsMan2482 ปีที่แล้ว

    how would I connect to this server from another computer?

  • @radheshgupta6029
    @radheshgupta6029 4 หลายเดือนก่อน

    The package used by anthony is deprecated as of august 2024

  • @gavrilenko2012
    @gavrilenko2012 6 หลายเดือนก่อน

    Hello, I have a question. My server response 200, and seems all working fine, however in my browser I got 403 error...
    Any ideas how to fix it?

  • @savimcgee7443
    @savimcgee7443 ปีที่แล้ว

    :8080. Definitely 8080!

  • @parthokr
    @parthokr ปีที่แล้ว

    ah huh you could have deleted the connection from conns on EOF

  • @zswang-iq3rl
    @zswang-iq3rl 6 หลายเดือนก่อน

    蟹蟹

  • @liampugh4705
    @liampugh4705 ปีที่แล้ว +1

    Age, sex, location?

    • @anthonygg_
      @anthonygg_  ปีที่แล้ว

      3458 bc, god, Valhala

  • @JDJ1213
    @JDJ1213 ปีที่แล้ว

    Age, sex, location.

  • @BilalJer
    @BilalJer ปีที่แล้ว +1

    Dafuq is heish

  • @PomogB
    @PomogB 6 หลายเดือนก่อน +2

    what about Content-Security-Policy?

    • @angstrom1058
      @angstrom1058 5 หลายเดือนก่อน

      I can't do what he's doing because of Content-Security-Policy. It happens also when I have a React app served by a Golang server, which is my core problem. In search of solutions. At least now, because of this video, I know it's a Content-Security-Policy problem. React / Chrome would just throw a 200 error and not say why. When I used the Chrome console directly, it spit out the Content-Security-Policy error. Chat GPT says for my React app, I need appropriate index.html headers. We'll see.

    • @maksimlevandovski1139
      @maksimlevandovski1139 5 หลายเดือนก่อน

      I had the same problem in this tut. But if u want to test your application locally, u could use the incognito tab in Google Chrome

  • @irrefl1672
    @irrefl1672 ปีที่แล้ว

    I think that can be improved your current implementation does not work: i did this: err = websocket.Message.Send(ws, "gracias amigo for el mensaje!!")
    if err != nil {
    log.Printf("write error: %s", err.Error())
    return
    }