Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Web Development with Julia and Genie

You're reading from   Web Development with Julia and Genie A hands-on guide to high-performance server-side web development with the Julia programming language

Arrow left icon
Product type Paperback
Published in Nov 2022
Publisher Packt
ISBN-13 9781801811132
Length 254 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ivo Balbaert Ivo Balbaert
Author Profile Icon Ivo Balbaert
Ivo Balbaert
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Part 1: Developing Web Apps with Julia
2. Chapter 1: Julia Programming Overview FREE CHAPTER 3. Chapter 2: Using Julia Standard Web Packages 4. Chapter 3: Applying Julia in Various Use Cases on the Web 5. Part 2: Using the Genie Rapid Web Development Framework
6. Chapter 4: Building an MVC ToDo App 7. Chapter 5: Adding a REST API 8. Chapter 6: Deploying Genie Apps in Production 9. Chapter 7: Adding Authentication to Our App 10. Chapter 8: Developing Interactive Data Dashboards with Genie 11. Index 12. Other Books You May Enjoy

Using WebSockets

WebSocket (ws://URL), or wss://URL for WebSocket Secure, is a bidirectional, low-latency, and high-speed protocol that builds on the TCP protocol. It uses HTTP(S) to make the connections (using ports 80 and 443, respectively), so it also needs the HTTP package. In a way, it combines characteristics of both UDP and TCP; it is message-based like UDP but also reliable and stateful like TCP. Chat services are among the most popular applications of WebSockets.

You can read data from or write data to a WebSocket, send ping or pong messages, and close the connection.

The WebSockets package can be found at https://github.com/JuliaWeb/WebSockets.jl, which contains a complete example of the chat service.

To start using the WebSockets package, add it via the REPL’s package mode:

(@v1.8) pkg> add WebSockets

The preceding command installs dependent packages such as URIs and HTTP and then precompiles them.

To set up a WebSocket, you need a URL and a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime