{"id":10891,"date":"2021-08-16T07:00:00","date_gmt":"2021-08-16T15:00:00","guid":{"rendered":"https:\/\/formtek.com\/blog\/?p=10891"},"modified":"2021-04-25T17:37:10","modified_gmt":"2021-04-26T01:37:10","slug":"html-over-websockets-responsiveness-with-low-latency-but-be-careful","status":"publish","type":"post","link":"https:\/\/formtek.com\/blog\/html-over-websockets-responsiveness-with-low-latency-but-be-careful\/","title":{"rendered":"HTML Over WebSockets: Responsiveness with Low Latency, but Be Careful"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Single-page Apps (SPA) have ruled developer mindsets over the last decade. The problem is that current SPA architectures are flawed.  On the front end, the developer writes Javascript-based applications that exchange JSON packages asynchronously to backend RESTful APIs. In this world, RESTful APIs rule. A problem is that the front end and the back end are typically written in two different languages and must be maintained separately and use JSON as the intermediary communication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An alternative to this approach is beginning to be explored by some development teams: <a href=\"https:\/\/alistapart.com\/article\/the-future-of-web-software-is-html-over-websockets\/\" data-type=\"URL\" data-id=\"https:\/\/alistapart.com\/article\/the-future-of-web-software-is-html-over-websockets\/\">HTML over WebSocket<\/a>.  In that approach, when a web app is initiated, the front end opens a WebSocket connection to the backend.  The front end requests content via URIs to the backend which responds by sending back HTML fragments that the front-end inserts into the page DOM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It turns out that this approach significantly reduces the use of Javascript because the HTML data fragment is constructed on the backend.  WebSockets is also a speedier protocol compared to HTTP.  For applications like chatbots, pushing communication back and forth via an open socket is particularly speedy. WebSocket apps have the potential to be<a href=\"https:\/\/hackernoon.com\/introduction-to-websockets-how-to-create-responsive-and-low-latency-applications-ym8c3631\" data-type=\"URL\" data-id=\"https:\/\/hackernoon.com\/introduction-to-websockets-how-to-create-responsive-and-low-latency-applications-ym8c3631\"> responsive with low latency<\/a>.  So, while the idea of the WebSocket approach has advantages and is gaining some traction, won&#8217;t the approach have its own set of weaknesses?  Everything always does.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generally the WebSocket approach is a win, but there are some potentially serious problems.  One is that processing is pushed back to the server, requiring more resources on the server, but a big issue is that the architecture makes it necessary to have a WebSocket open for every client.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.linkedin.com\/in\/jgillam\/\" data-type=\"URL\" data-id=\"https:\/\/www.linkedin.com\/in\/jgillam\/\">Jason Gillam<\/a>, <a href=\"https:\/\/securityboulevard.com\/2020\/03\/once-upon-a-time-there-was-a-websocket\/\" data-type=\"URL\" data-id=\"https:\/\/securityboulevard.com\/2020\/03\/once-upon-a-time-there-was-a-websocket\/\">analyzed one app built as an SPA WebSocket app<\/a> and found numerous security issues with the implementation, attributed to the fact that WebSocket apps aren&#8217;t as well understood as the dominant HTTP implementations.  While one app can&#8217;t represent all apps, it does make one pause.  Gillam wrote that &#8220;We therefore believe organizations should be extra cautious of WebSockets and understand that they are often misunderstood and not implemented with proper security controls in place.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div class=\"lightsocial_container\"><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/digg.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/digg.png\" alt=\"Digg This\" title=\"Digg This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/reddit.png\" alt=\"Reddit This\" title=\"Reddit This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.stumbleupon.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/stumbleupon.png\" alt=\"Stumble Now!\" title=\"Stumble Now!\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/buzz.yahoo.com\/buzz?targetUrl=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F&amp;headline=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/yahoo_buzz.png\" alt=\"Buzz This\" title=\"Buzz This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.dzone.com\/links\/add.html?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dzone.png\" alt=\"Vote on DZone\" title=\"Vote on DZone\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.facebook.com\/sharer.php?t=&amp;u=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/facebook.png\" alt=\"Share on Facebook\" title=\"Share on Facebook\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/delicious.com\/save?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/delicious.png\" alt=\"Bookmark this on Delicious\" title=\"Bookmark this on Delicious\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.dotnetkicks.com\/kick\/?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dotnetkicks.png\" alt=\"Kick It on DotNetKicks.com\" title=\"Kick It on DotNetKicks.com\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/dotnetshoutout.com\/Submit?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dotnetshoutout.png\" alt=\"Shout it\" title=\"Shout it\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F&amp;title=&amp;summary=&amp;source=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/linkedin.png\" alt=\"Share on LinkedIn\" title=\"Share on LinkedIn\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.technorati.com\/faves?add=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/technorati.png\" alt=\"Bookmark this on Technorati\" title=\"Bookmark this on Technorati\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/twitter.com\/home?status=Reading+https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/twitter.png\" alt=\"Post on Twitter\" title=\"Post on Twitter\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.google.com\/buzz\/post?url=https%3A%2F%2Fformtek.com%2Fblog%2Fhtml-over-websockets-responsiveness-with-low-latency-but-be-careful%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/google_buzz.png\" alt=\"Google Buzz (aka. Google Reader)\" title=\"Google Buzz (aka. Google Reader)\" \/><\/a><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Single-page Apps (SPA) have ruled developer mindsets over the last decade. The problem is that current SPA architectures are flawed. On the front end, the developer writes Javascript-based applications that exchange JSON packages asynchronously to backend RESTful APIs. In this<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/formtek.com\/blog\/html-over-websockets-responsiveness-with-low-latency-but-be-careful\/\">Read more &#8250;<\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[],"class_list":["post-10891","post","type-post","status-publish","format-standard","hentry","category-code-development"],"_links":{"self":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts\/10891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/comments?post=10891"}],"version-history":[{"count":1,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts\/10891\/revisions"}],"predecessor-version":[{"id":10892,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts\/10891\/revisions\/10892"}],"wp:attachment":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/media?parent=10891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/categories?post=10891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/tags?post=10891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}