Upload File using Akka-HTTP and Binary protocol in Scala through web socket.

Hello All,

In this blog we are using Akka-HTTP and Binary protocol to Upload File .

Binary protocol

A binary protocol is a protocol which is intended or expected to be read by a machine rather than a human being, as opposed to a plain text protocol such as IRC, SMTP, or HTTP.
Binary protocols have the advantage of terseness, which translates into speed of transmission and interpretation.

Binary protocol is also used in the context of a protocol between exactly two parties, in contrast to a multi-party protocol.Binary protocol, or binary collaboration have been used in the terminology of standards such as EbXML and EDOC.[1] An interface in UML [2] may also be considered a binary protocol.

With the help of binary protocol and Akka-HTTP we developed a mini project which can upload file.

  1. To upload file using binary protocol we are using DWST(Dark WebSocket Terminal) .
  2.  Server is running on  localhost:3000 .

You can find complete code Here

Connect with server using DWST command  /connect ws://localhost:3000/upload


Hit /loadbin command on DWST to upload file this will open you picture folder.


Select an image which you want to Upload .


After seletcting file you will get a message,  Binary file loaded to “default”


Now you file is loaded at default location of DWST . Now hit /binary [bin] to upload file on server .


Now your file is uploaded on the server at /tmp directory.


Binary protocol

Thanks !!!


1 thought on “Upload File using Akka-HTTP and Binary protocol in Scala through web socket.

Leave a Reply

%d bloggers like this: