PikeHTTP Client Library (Component to Application Server)

The PikeHTTP(S) client enables embedded devices to communicate with any web server and to upload and download any type of data. Devices can independently retrieve files such as configuration files and software updates, enabling large arrays of devices to be updated simultaneously without direct, one-by-one reconfiguration.

FEATURES:

  • Offers persistent connections and unlimited file sizes for upload and download
  • Supports HTTP authentication, server authentication with Certificate Authorities Validation, and client authentication with client certificate
  • Compliant with HTTP 1.0/1.1, SOCKS5 and HTTPS proxy, and TLS/SSL security
  • Allows use of data streaming and WebSockets
  • Includes easy-to-use command API with a high-level API for common operations
  • Supports HTTP cookies

The Barracuda Application Server includes PikeHTTP
(HTTP and HTTPS client).

PikeHTTP Can Be Purchased in Multiple Configurations:

  • PikeHTTP(S) client C library comes as a pre-integrated component of the Barracuda Application Server
  • PikeHTTP(S) standalone client is typically used in devices that require communication with a central server product or as a base for designing automatic firmware upgrade functionality
  • PikeHTTP(S) standalone client integrated with SharkSSL embedded SSL/TLS
  • PikeHTTP(S) standalone client integrated with SharkSSL and the JSON parser/serializer to easily send control messages over HTTPS.

Barracuda Application Server and PikeHTTP

The PikeHTTP C library comes as a pre-integrated component of the Barracuda Application Server and includes Lua bindings (Lua to C connector) making it easy to use the HTTP client library from Lua code.

The example to the right shows how to use the Lua API and how one can use the HTTP client library to download new firmware versions from the company main server. The example shows how to use the client from behind a proxy. The company main server requires the client to login. In addition, the firmware is packaged as a ZIP file and password protected. The Barracuda Server's integrated ZIP file system supports AES 256 bits encryption, the new ZIP file encryption standard.


local http=require"httpm"

-- Create a HTTP client obj
local httpc=http.create{
   -- client behind a proxy
   proxy="my-local-proxy",
   proxyuser="myuser",
   proxypass="mypass"
}

-- Download firmware
local ok,err=httpc:download{
   -- Local file system IO
   io=ba.openio"disk",
   -- Save data in io, location:
   name="/tmp/firmware.zip",
   -- Use sharkSSL for https://
   shark=ba.create.sharkssl(nil,ba.create.sharkcert()),
   -- Secure URL to company main server
   url="https://company.com/firmware.zip",
   -- Main server requires the client to authenticate
   user="company-username",
   password="company-password"
}

-- Download OK
if ok then
   -- Create ZIP IO by using the downloaded ZIP file
   local io=ba.mkio(ba.openio"disk","/tmp/firmware.zip")
   if io then
      -- Firmware encoded with 256 bits AES encryption.
      io:setpasswd"the-firmware-zipfile-pass"
      -- use IO to extract data, see IO documentation
   end
end