Real Time communication library using Animated Gifs as a transport™

Related tags

Messaging gifsockets
Overview

gifsockets

"This library is the websockets of the '90s" - Somebody at Hacker News.

This library shows how to achieve realtime text communication using GIF images as transport.

Mind Blown

The interesting part is that you can even use IE6 with this library and get the data in Real Time (TM).

Of course this should have been delivered as an April's Fools joke but sadly we are in mid September here in the northern hemisphere.

See it in action in this video: https://vimeo.com/49447841.

How does it work

The idea is pretty simple. We use Animated Gif images to stream data in real time to the browser. Since a gif image doesn't specify how many frames it has, once the browser opens it, it will keep waiting for new frames until you send the bits indicating that there's no more image to fetch.

Pretty simple uh!

And yes. It works in IE6.

Usage

The usage now is a bit rudimentary and manual. Feel free to improve it and send a PR.

$ git clone git://github.com/videlalvaro/gifsockets.git
$ cd gifsockets
$ lein deps
% lein repl

Then perform the following commands on the Clojure REPL.

;; in the repl do the following to import the libs
(use 'gifsockets.core)
(use 'gifsockets.server)
;;
;;Then we declare the tcp server
(def server (tcp-server :port 8081 :handler gif-handler))
(start2 server)
;; wait for a browser connection on port 8081
;; go and open http://localhost:8081/ in Safari or IE6
;; In Chrome it works a bit laggy and in Firefox it doesn't work at all
;;
;; Now let's create the gif encoder that we use to write messages to the browser.
(def encoder (create-gif (.getOutputStream client)))
;;
;;Now we are ready to send messages to that browser client
(add-message encoder "Hello gif-sockets")
;; now you should see a GIF image with the new message on it.
(add-message encoder "Zup zup zup")
(add-message encoder "And so forth")
;;
;; Now let's clean up and close the connection
(.finish encoder)
(.close client)

As you can see from the code this handles only one connection in what is called an UPoC (Uber Proof Of Concept).

Possible uses:

All joking aside I think this is a very low tech way to have say, a website where you could tail logs for instance and you need to do it with a browser that have zero websockets support or something like that.

Or what about progress bars for stuff that your server is doing in the background, say, while it resizes an image?

Yes. You need gifsockets.

NOTE:

If you need a good library for real time communications on the web then I would recommend using sockjs.

License

Copyright © 2012 Alvaro Videla

The following classes:

  • AnimatedGifEncoder.java
  • GifDecoder.java
  • LZWEncoder.java
  • NeuQuant.java

Were taken from this website: http://www.fmsware.com/stuff/gif.html.

And the server code was taken from here https://github.com/weavejester/tcp-server

The awesome image that illustrates this page was given by the internet.

Distributed under the Eclipse Public License, the same as Clojure.

CREDITS

I've stole this idea (ehem, took inspiration) from a chat a colleague showed me like three years ago. It wasn't open source back then and I was always wondering how to implement something like that. So kudos to Ka-Ping Yee, who had the original idea.

Thanks simonw for posting the link to the original chat.

You might also like...

High Performance Inter-Thread Messaging Library

LMAX Disruptor A High Performance Inter-Thread Messaging Library Maintainer LMAX Development Team Support Open a ticket in GitHub issue tracker Google

Jan 9, 2023

KC4Streams - a simple Java library that provides utility classes and standard implementations for most of the Kafka Streams pluggable interfaces

KC4Streams (which stands for Kafka Commons for Streams) is a simple Java library that provides utility classes and standard implementations for most of the Kafka Streams pluggable interfaces.

Mar 2, 2022

A tool to make dumpy among us GIFS

Among Us Dumpy Gif Maker Made by ThatOneCalculator & Pixer415 With help from twistCMYK, karl-police, and auguwu! Please credit this repository when yo

Jan 7, 2023

a simple program to turn stockX images into gifs!

a simple program to turn stockX images into gifs!

StockX Gif Converter make stockx images look cool Idea I got this idea from Fyko/stockx-gif-next Usage import me.brennan.stockxgiffer.StockXGiffer; p

Jul 19, 2022

About I build a custom animated alert dialog with rounded corners - Java🚀🔥

Custom Animated AlertDialog Animated AlertDialog With Rounded Corners Alert Dialog Style First you need add this code to your project themes.xml file

Jul 15, 2022

Simple animated PNG and GIF screen recorder

Simple animated PNG and GIF screen recorder

Japagoge (PNG and GIF screen recorder) Warning In Linux. If you get black screen as grabbing result, then it is bug JDK-8269245. You can switch your s

Sep 5, 2022

Time-Based One-Time Password (RFC 6238) and HMAC-Based One-Time Password (RFC 4226) reference implementations and more.

Crypto Time-Based One-Time Password (RFC 6238) and HMAC-Based One-Time Password (RFC 4226) reference implementations and more. Getting Started TOTP ge

May 12, 2022

Messenger(Chat app) is a real time one to one chat application with Push Notifications made using Firebase...

Messenger(Chat app) is a real time one to one chat application with Push Notifications made using Firebase...

Messenger If you want a APK then create an issue, i'll send the link.. ChatApp is a real time one to one chat application with Push Notifications made

Apr 30, 2022

A near real time Data Warehouse using the MeshJoin Algorithm

MeshJoin-Data-Warehouse A near real time Data Warehouse using the MeshJoin Algorithm Steps to run the project: Step 1: Run the createDW.sql file -This

Dec 1, 2022

LOQUI - Real-time chat application built using Apache Kafka, Java, Spring Boot, SockJS and React

LOQUI - Real-time chat application built using Apache Kafka, Java, Spring Boot, SockJS and React

LOQUI is a simple real-time chat application that demonstrates how to use Apache Kafka as a message broker along with Java, Spring Boot and React on the front-end

Jun 5, 2022

A real-time ray tracer in Java, accelerated on heterogeneous hardware using TornadoVM

A real-time ray tracer in Java, accelerated on heterogeneous hardware using TornadoVM

Java Ray Tracer for TornadoVM Description This project aims to build a real-time ray tracer in Java, accelerated on heterogeneous hardware using Torna

May 23, 2022

Logstash - transport and process your logs, events, or other data

Logstash Logstash is part of the Elastic Stack along with Beats, Elasticsearch and Kibana. Logstash is a server-side data processing pipeline that ing

Jan 5, 2023

Efficient reliable UDP unicast, UDP multicast, and IPC message transport

Aeron Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java and C++ clients are available in this repository, and a .NET clie

Jan 9, 2023

Efficient reliable UDP unicast, UDP multicast, and IPC message transport

Aeron Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java and C++ clients are available in this repository, and a .NET clie

Dec 27, 2022

Efficient reliable UDP unicast, UDP multicast, and IPC message transport

Efficient reliable UDP unicast, UDP multicast, and IPC message transport

Aeron Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java and C++ clients are available in this repository, and a .NET clie

Jan 9, 2023

Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport

Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport

Cammie's Minecart Tweaks Cammie's Minecart Tweaks is a mod that makes Minecarts a more viable solution for long-distance transport. Minecarts can't co

Jul 2, 2022

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

ChartFx ChartFx is a scientific charting library developed at GSI for FAIR with focus on performance optimised real-time data visualisation at 25 Hz u

Jan 2, 2023

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.

ChartFx ChartFx is a scientific charting library developed at GSI for FAIR with focus on performance optimised real-time data visualisation at 25 Hz u

Dec 30, 2022
Comments
  • IllegalArgument

    IllegalArgument

    Upon running (def encoder (create-gif (.getOutputStream client))) in the REPL:

    IllegalArgumentException No matching field found: getOutputStream for class clojure.lang.Var$Unbound clojure.lang.Reflector.getInstanceField (Reflector.java:271)

    opened by astanway 1
  • Project seems unmaintained

    Project seems unmaintained

    gifsockets is an awesome project. The overall design of the project is flawless and easy to understand. It is also backwards compatible to IE6 which solves a lot of real world issues.

    But we have one problem: The project seems dead and unmaintained.

    Anyone steps up to merge solve the open issues?

    opened by dasrecht 2
Owner
Alvaro Videla
Work @Microsoft - @DuraznoConf Organizer. Coauthor of RabbitMQ in Action. Ex 🍎 - Ex RabbitMQ Core Dev. Opinions my own and not those of my employer.
Alvaro Videla
Dagger is an easy-to-use, configuration over code, cloud-native framework built on top of Apache Flink for stateful processing of real-time streaming data.

Dagger Dagger or Data Aggregator is an easy-to-use, configuration over code, cloud-native framework built on top of Apache Flink for stateful processi

Open DataOps Foundation 238 Dec 22, 2022
Firehose is an extensible, no-code, and cloud-native service to load real-time streaming data from Kafka to data stores, data lakes, and analytical storage systems.

Firehose - Firehose is an extensible, no-code, and cloud-native service to load real-time streaming data from Kafka to data stores, data lakes, and analytical storage systems.

Open DataOps Foundation 279 Dec 22, 2022
SeaTunnel is a distributed, high-performance data integration platform for the synchronization and transformation of massive data (offline & real-time).

SeaTunnel SeaTunnel was formerly named Waterdrop , and renamed SeaTunnel since October 12, 2021. SeaTunnel is a very easy-to-use ultra-high-performanc

The Apache Software Foundation 4.4k Jan 2, 2023
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

EventBus EventBus is a publish/subscribe event bus for Android and Java. EventBus... simplifies the communication between components decouples event s

Markus Junginger 24.2k Jan 3, 2023
Examples using libp5x

Examples for libp5x libp5x is a modularized fork of Processing used inside PraxisLIVE. Based on Processing v3.5.3, it fully supports Java 11+ and the

Codelerity 4 May 17, 2021
FLiP: StreamNative: Cloud-Native: Streaming Analytics Using Apache Flink SQL on Apache Pulsar

StreamingAnalyticsUsingFlinkSQL FLiP: StreamNative: Cloud-Native: Streaming Analytics Using Apache Flink SQL on Apache Pulsar Running on NVIDIA XAVIER

Timothy Spann 5 Dec 19, 2021
Microservice-based online payment system for customers and merchants using RESTful APIs and message queues

Microservice-based online payment system for customers and merchants using RESTful APIs and message queues

Daniel Larsen 1 Mar 23, 2022
Kafka example - a simple producer and consumer for kafka using spring boot + java

Kafka example - a simple producer and consumer for kafka using spring boot + java

arturcampos 1 Feb 18, 2022
A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. A pure

Ignite Realtime 2.3k Dec 28, 2022
A JVM library to use RabbitMQ as an embedded service

Embedded RabbitMQ Compatibility: Builds: Linux OS X Windows Reports: Dist: Social: This library allows for the use of various RabbitMQ versions as if

Alejandro Rivera 88 Dec 25, 2021