We may earn an affiliate commission when you visit our partners.
Paris Liakos

WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol enables interaction between a web browser (or other client application) and a web server with lower overhead than half-duplex alternatives such as HTTP polling, facilitating real-time data transfer from and to the server.

Rust is a systems programming language which you can use to write applications with high performance. It is amazingly refreshing with a very helpful compiler who is your mentor since the very beginning.

Read more

WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol enables interaction between a web browser (or other client application) and a web server with lower overhead than half-duplex alternatives such as HTTP polling, facilitating real-time data transfer from and to the server.

Rust is a systems programming language which you can use to write applications with high performance. It is amazingly refreshing with a very helpful compiler who is your mentor since the very beginning.

Given that the WebSocket protocol is key for real-time applications, where reliability and speed matter, it is no wonder that Rust is the best option for implementing WebSocket servers.

Also given that Rust can now run in the browser, thanks to WebAssembly, we can also use Rust on the client.

Which means that one can code a real-time, chat-like application 100% in just Rust.

This is what we will do in this course. We will leverage Tokio and Rocket in the back-end, yew webassembly and trunk in the front-end and we will end up with a full-stack Rust, real-time chat app. While doing that we will learn how to set-up a WebSocket connection, send/receive messages and update out application state.

Enroll now

What's inside

Learning objectives

  • Creating websocket clients with yew
  • Creating websocket servers with rocket
  • Sharing rust code between server and client
  • Building a chat frontend with yew

Syllabus

Introduction
Local setup
Gitlab repository
Implement a websocket server in the Rocket web framework
Read more
Rocket setup
Stream split
Atomic user ID and rocket state
Mutex and locks
ChatRoom implementations
Implement a websocket client in the Yew web framework
Yew setup
Hooks and websocket connection
Message sending
Bootstrap styling
JSON messages
ChatMessage contract
Backend and JSON
Frontend and JSON
Chatroom users list
Websocket message types
Broadcasting user list
User list component
Changing usernames
Username change message type
Storing the username
Username change FE logic
Username change BE logic
System messages
Username changed system message
User joined/left system message
System messages styling

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Leverages Tokio and Rocket in the back-end and Yew WebAssembly in the front-end, which are valuable tools and frameworks for Rust developers
Explores WebSocket protocol, which enables interaction between a web browser and a web server with lower overhead than half-duplex alternatives such as HTTP polling
Teaches how to set up a WebSocket connection, send/receive messages, and update application state, which are essential skills for building real-time applications
Requires knowledge of Rust, Tokio, Rocket, Yew WebAssembly, and Trunk, which may require learners to acquire new skills before taking the course
Focuses on building a chat application, which may not be relevant to learners interested in other types of real-time applications

Save this course

Save Real time web applications in Rust to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Real time web applications in Rust with these activities:
Review Rust Concurrency
Reviewing Rust's concurrency features, especially Tokio, will help you understand the asynchronous nature of WebSocket servers and clients.
Show steps
  • Read the Tokio documentation on asynchronous tasks.
  • Practice creating and managing asynchronous tasks.
  • Experiment with channels for communication between tasks.
Read 'Programming WebAssembly with Rust'
Reading 'Programming WebAssembly with Rust' will deepen your understanding of how Yew works and how to optimize your client-side code.
Show steps
  • Read the chapters on memory management and interfacing with JavaScript.
  • Experiment with different optimization techniques.
  • Relate the concepts to the Yew framework.
Read 'Rust in Action'
Reading 'Rust in Action' will provide a deeper understanding of Rust's systems programming capabilities, which are relevant to building high-performance WebSocket applications.
Show steps
  • Read the chapters on concurrency and networking.
  • Try the examples in the book.
  • Relate the concepts to the course material.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Practice Tokio Stream Handling
Practicing stream handling with Tokio will improve your ability to manage WebSocket connections efficiently.
Show steps
  • Create a series of exercises involving reading from and writing to Tokio streams.
  • Implement different stream transformations and combinators.
  • Test your code thoroughly.
Build a Simple Chat Client
Building a simple chat client using Rust and WebSockets will solidify your understanding of the concepts taught in the course.
Show steps
  • Set up a basic WebSocket server using Rocket.
  • Create a client using Yew to connect to the server.
  • Implement basic message sending and receiving.
  • Add a simple user interface.
Write a Blog Post on Rust WebSockets
Writing a blog post explaining how to build real-time web applications with Rust and WebSockets will reinforce your learning and help you share your knowledge with others.
Show steps
  • Choose a specific aspect of Rust WebSockets to focus on.
  • Research the topic thoroughly.
  • Write a clear and concise blog post.
  • Include code examples and diagrams.
  • Publish the blog post on a platform like Medium or your own website.
Contribute to a Rust WebSocket Library
Contributing to an open-source Rust WebSocket library will provide valuable experience and help you learn from other developers.
Show steps
  • Find an open-source Rust WebSocket library on GitHub.
  • Identify a bug or feature request to work on.
  • Submit a pull request with your changes.
  • Respond to feedback from the maintainers.

Career center

Learners who complete Real time web applications in Rust will develop knowledge and skills that may be useful to these careers:
Full-Stack Developer
Full stack developers are responsible for both front-end and back-end development. This course provides a practical guide to building a full-stack application using Rust, covering topics such as setting up WebSocket connections, sending/receiving messages, and updating application states. It introduces you to the Rust ecosystem’s web frameworks as well as client-side technologies. A full stack developer can use this course to learn how to write performant and reliable real-time applications in Rust. This course is unique in that it provides a full stack solution using only Rust.
Web Application Developer
A web application developer creates and maintains websites and web-based applications. This course helps a web application developer to build full stack applications using Rust, a language frequently used for high performance applications. The course demonstrates how to establish WebSocket connections, send and receive messages, and update application states. It shows you how use Rust on both client and server. The course helps a web application developer become more familiar with front end technologies such as WebAssembly and Yew.
Backend Developer
A backend developer focuses on the server-side logic of applications. This course teaches the use of Rust for implementing WebSocket servers, a critical component for real time applications. The course provides the practical knowledge of building robust and efficient backend systems that handle real-time data transfer using Rocket framework. It will help backend developers understand how to establish connections, manage concurrent operations, and how to transfer information in the backend using JSON messages. A backend developer will find this course useful to understand how to use Rust to create reliable and performant server applications.
Frontend Developer
Frontend developers build the user interface of applications. This course helps a frontend developer learn how to use WebAssembly and Yew to create responsive and interactive user interfaces. The course covers the process of implementing WebSocket clients, sending and receiving messages, and managing application states. It focuses on using the Rust programming language in the front end. Frontend developers who want to learn how to leverage Rust, WebAssembly, and Yew will benefit from this course.
Software Engineer
Software engineers design, develop, and maintain software systems. This course may be useful for a software engineer who wants to work with websocket servers and clients. The course teaches how to implement a real-time chat application fully in Rust. It covers backend and frontend technologies, demonstrating how to set up a WebSocket connection, send and receive messages, and manage application states. It also discusses state-of-the-art Rust frameworks for server-side development like Rocket, and client-side technologies like WebAssembly and Yew.
Systems Programmer
Systems programmers create and maintain low-level software that interacts directly with the hardware. Rust is a language often used in systems programming. This course uses Rust to create a real-time chat application. This course demonstrates how to use Rust to build powerful and efficient applications. The course provides an example of how to implement a WebSocket server with Rocket, and how to implement a client using WebAssembly and Yew. The course further covers topics such as message handling, state management, and concurrent operations using Rust's tool chain.
Embedded Systems Engineer
Embedded systems engineers design and develop software for embedded devices. This course may be a good fit for these engineers due to its focus on Rust, a language that can be used in embedded systems development. It teaches how to write efficient and reliable applications using Rust. The skills learned, including how to set-up websocket connections and how to send and receive messages, will be useful. An embedded systems engineer will find the course helpful in learning how to use Rust in real world applications.
Game Developer
Game developers create video games for various platforms. This course may be helpful for a game developer, particularly those interested in real time multiplayer functionality. The course teaches how to create websocket clients and servers using Rust. The course also covers sending and receiving messages. The skills learned in creating a full stack application using Rust may be beneficial to a game developer.
Network Engineer
Network engineers design, implement, and manage computer networks. This course may be useful for networking engineers interested in real-time data transfer techniques. The course covers full-duplex communication using the WebSocket protocol. It shows how to set up a WebSocket connection, send and receive messages, and update application states. The knowledge of how to manage connections and manage data transfer learned in this course will be helpful for a network engineer.
Mobile Application Developer
Mobile application developers create applications for mobile devices. This course may be useful for mobile app developers that want to leverage Rust in their development stack. The course covers how to build real-time applications with Rust. It explores both front and back end technologies. This course will help a mobile application developer to have greater flexibility and more options in terms of cross platform development since Rust can be compiled to different target platforms.
DevOps Engineer
DevOps Engineers are responsible for the deployment and maintenance of software applications. This course may be useful for a DevOps engineer to understand how Rust applications are written including full-stack, real-time applications. The course covers how to set up WebSocket connections, send and receive messages, and update application states. A DevOps engineer can utilize the knowledge of this course to better understand how applications function in order to create more robust deployment strategies.
Cloud Engineer
Cloud engineers manage and maintain cloud infrastructure. This course may be helpful for cloud engineers who want to use Rust to build scalable and performant cloud applications. The course explores the use of Rust in real-time applications. It also introduces WebSocket, a technology essential for cloud applications that need real time data transfer. A cloud engineer may find this course useful to understand how to make use of Rust when building applications that run in their cloud environment.
Data Engineer
Data engineers design and build systems for collecting, storing, and processing large datasets. This course may be useful for a data engineer wanting to build systems that use real time data streams using websockets. The course focuses on building real time web applications using Rust and websocket connections. A data engineer can use the knowledge from the course to build real time data pipelines.
Technical Consultant
Technical consultants provide expertise to clients on information technologies. This course may help a technical consultant become more knowledgeable in modern web technology and Rust. This course covers building a full stack application using Rust and Websockets. This gives the technical consultant a better understanding of these technologies so they can provide better solutions to their clients.
Technical Writer
Technical writers create documentation for software and hardware products. This course may be useful for technical writers who want to gain deeper understanding of Rust and real time web development. The course covers building a full stack web application using Rust from the ground up. This will help the technical writer to produce more accurate and insightful documentation about these technologies.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Real time web applications in Rust.
Provides a comprehensive guide to using Rust to build WebAssembly modules. It covers topics such as memory management, interfacing with JavaScript, and optimizing for performance. Given that the course uses Yew, which compiles to WebAssembly, this book will be very helpful in understanding the client-side aspects of the application. It valuable resource for those who want to learn how to build high-performance web applications with Rust.
Provides a practical, hands-on approach to learning Rust. It covers many of the core concepts used in the course, such as concurrency and networking. While not specifically focused on web applications, it provides a solid foundation for understanding the underlying principles. It valuable resource for those who want to deepen their understanding of Rust beyond the basics.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser