Course Overview
WebSockets are a technology that allows developers to build highly interactive, extremely fast web applications. Since WebSockets are supported by all modern browsers, and have been for years now, there is no reason why they cannot be implemented on any modern web application. This course will show you how to work with WebSockets with Go.
We will work with two kinds of WebSocket technologies: first, with simple calls directly from our web application to all connected browsers, where all functionality is handled by our application. The web application we'll build is a simple chat application, which will allow users to chat back and forth, and will show the list of connected users, updated in real time.
Next, we'll take advantage of a Pusher compatible server (or Pusher itself, if you prefer) and use that server as a message broker between our web application and all connected clients.
I am a firm believer that learning how to use a particular technology works best when applying it to a real-world situation. All too often, tutorials and courses over simplify what they are trying to teach, and create an artificial environment where things are so simple that what is being taught looks easy enough, but you immediately run into problems when trying to implement it on a more complex project. So, to implement and learn about WebSockets and Pusher, we'll build a web application which monitors remote servers and hosts, and notifies us in real-time when a service goes down or comes back up again. We will send notifications in real time using WebSockets (which will update the appropriate content on the pages being viewed by all connected clients), by email, and, as a bonus, we'll also learn how to send notifications using text messages (SMS) with Twilio.
FAQ
FAQ area empty
Course curriculum
Chương 1 Introduction & Setup 4 bài · 8 phút
Chương 2 Our First Project: Chat 14 bài · 1 giờ 41 phút
-
What are we going to build? 1:25
- Setting up a simple application Học thử 13:07
- Creating a handler to "upgrade" a connection to websockets Học thử 6:42
-
Connecting to the websocket endpoint 6:35
- Adding additional socket event handlers Học thử 8:14
-
Improving our WS endpoint, and setting up go routines 13:58
-
Listing all users 14:15
-
Fixing a problem with disappearing users 5:16
-
One minor fix 1:53
-
Sending messages 12:56
-
Cleaning things up 5:42
-
What if the server goes away? Reconnecting painlessly 5:36
-
Adding server status indicator 5:42
-
Review of Javascript for communicating over websockets
Chương 3 Project II: Vigilate, a server monitoring system 7 bài · 59 phút
-
What are we going to build? 5:25
-
Install Postgres and a Postgres Client 3:57
-
Installing the starter project's source code 22:11
-
Fixing a typo in the config.yml
-
Connecting to Pusher 19:07
-
Pushing an event to the client 8:38
-
Connecting to a Pusher server in Javascript
Chương 4 Setting up our Application 27 bài · 4 giờ 44 phút
-
Setting up some database tables 15:30
-
Setting up models 9:41
-
Creating forms for our hosts 18:30
-
Adding form validation, and setting up a handler for posting data 6:24
-
Passing data to our host form 7:31
-
Inserting a host into the database 19:20
-
Getting and updating a host 11:17
-
Modifying the post handler for hosts to update 7:50
-
Getting all hosts and displaying on page 10:57
-
Adding services to a host 1 7:33
-
Adding services to a host 2 6:06
-
Adding services to a host 3 13:31
-
Adding services to a host 4 5:38
-
Database functions to add/remove a service from host 7:34
-
Listing host services in a more intelligent way 13:08
-
Listing all services on overview page 15:11
-
Showing service status counts on overview page 9:38
-
List all services by status 17:10
-
Updates for Go 1.16 2:06
-
Adding service status to the host page 16:38
-
Making things a bit more visually appealing 6:43
-
Manually Testing a host service 1 13:31
-
Manually Testing a host service 2 9:20
-
Manually testing a host service 3 12:43
-
Manually testing a host service 4 12:14
-
Manually testing a host service 5 8:35
-
Sending an AJAX request to test a service
Chương 5 Monitoring Services 9 bài · 1 giờ 29 phút
-
Setting up a schedule to monitor services 12:27
-
An Aside: Updating the chi router 2:37
-
Monitoring part 2 14:05
-
Monitoring part 3 18:07
-
Monitoring part 4 7:24
-
Monitoring part 5 9:42
-
Monitoring part 6 5:16
-
Monitoring part 7 12:13
-
Monitoring part 8 6:55
Chương 6 Implementing Websockets on Vigilate 22 bài · 3 giờ 54 phút
-
Pushing monitoring start/stop events to client 9:10
-
Setting up a local server to monitor 1:16
-
Running service checks 9:15
-
Pushing events on host service status change 7:36
-
Updating service status count in real time 11:58
-
Cleaning up our code 5:54
-
Updating tables on the host page when status changes 26:06
-
Exercise: Update Overview sub-pages 1:51
-
Solution to exercise 5:05
-
Displaying the monitoring schedule 18:19
-
Updating the schedule page in real time 21:22
-
Turning services on and off in real-time 31:43
-
Pushing events after a manual check 2:45
-
Saving and displaying events 22:22
-
Cleaning things up 10:25
-
Sending an event to a private channel 8:05
-
Installing Mailhog on a Mac 2:56
-
Installing Mailhog on Windows 0:56
-
Sending notifications via email 16:18
-
Sending notifications via text (SMS) 2:38
-
Setting up a Twilio Account 2:14
-
Writing the code to send SMS messages 15:17
Chương 7 Monitoring Additional Services 3 bài · 25 phút
-
Setting up two new services 10:01
-
Monitoring HTTPS services 2:58
-
Monitoring SSL certificates 11:52
Chương 8 Writing Tests 3 bài · 48 phút
-
Handler Tests 28:58
-
Websocket Tests (the wrong way) 7:49
-
Websocket Tests (the right way) 11:08
Requirment
-
A basic knowledge of the Go programming language
-
A basic knowlege of Javascript
-
An internet connected computer (Windows, Mac, or Linux)
Outcomes
-
How to work with Websockets in Go (Golang)
-
How to build a real-time, responsive application using websockets
-
How to connect to third party services like Pusher, and how to use our own self-hosted Pusher-compatible service
-
How to build a real-time server monitoring web application
-
How to schedule periodic events in Go
-
How to write tests for websocket handlers
-
The basics of building a secure web application in Go
-
How to send SMS messages with Go using Twilio
0 Student
12 Courses
0 review