Ioto 1.4.0 Update

launch

I’m pleased to announce the release of Ioto 1.4.0.

This release provides some important developer usability tools that make tracing web server HTTP requests simpler and clearer.

We’ve also continuted to extend our suite of unit and service tests and this has resulted in a solid set of minor bug fixes.

All users of previous Ioto versions 1.X are encouraged to update to the new version.

Major Changes

The most significant changes in this release are:

HTTP Client Test Program

This release includes a HTTP client test program called “url”. This is a developer aid to issue test requests and simulate load tests on the Ioto web server. While there are many other HTTP clients available, the URL program has a very terse syntax suitable for daily test needs. It also demonstrates how to elegantly use the URL API in your programs.

The url command makes it easy to issue test HTTP requests via a smart command line:

url [options] [Method] url [items, ...]

For example:

  url /
  url /index.html
  url POST /test/show name=louise
  url POST /test/show '{name:"louise"}'
  url PUT /upload @file
  url POST /switch op=on 'X-Auth=1828442'

In most cases, you can abbreviate the URL to just the non-default components you require.

You can also perform load tests. For example:

url --benchmark --clients 16 --count 10000 /test

This will issue 10,000 requests to the /test with up to 16 simultaneous clients.

See the documentation at: https://www.embedthis.com/agent/doc/man/url.txt

Web Redirects

The Ioto embedded web server can be configured to redirect requests to preferred destinations and protocols.

The Ioto config/web.json5 configuration file defines URL redirections from one URL to a new URL via the redirect collection. For example:

redirect: [
    { status: 302, from: "http", to: "http" },
    { status: 302, from: "example.com", to: "new-example.com" },
    { status: 302, from: "http://example.com:8080", to: "https://new-example.com" },
    { status: 302, from: "http://example.com", to: "https://new-example.com" },
    { status: 302, from: ":443", to: "https://:4443" },
    { status: 301, from: "/old", to: "/new.html" },
],

This release enhances the redirection matching algorithm using the “from” URL components to match the current request to the appropriate redirection.

If the “from” URL component matches, the “to” property is used to define additional or overriding URL components that are blended with the current request and the client is redirected to this new request URL.

Each redirection defines a matching pattern. If the from argument matches the current request, then that redirection definition is applied.

The “from” property defines a URL portion that must match for the redirect. You only need to specify the URL portion that you wish to use as a matching pattern. If the “from” property is omitted, it will match all URLs.

The “from” and “to” URLs are of the form:

[http|https][://][hostname][:port][/path][?query][#hash]

Any of the URL components may be present or absent. For example, if only a path is supplied for the “to” property, then the client will be redirected to the new path on the current site.

The “to” URL defines a URL portion that will be combined with the existing URL. The to URL may be local to the system, in which case it will begin with a “/” character, or it may be on another system, in which case it will begin with “http://” or “https://”. In both cases, the user will receive a HTTP redirection response informing them of the new location of the document.

The status argument may be either 301 for a permanent redirect or 302 for a temporary redirect. The default is 302.

Web Server HTTP Tracing

This Ioto release adds special control for tracing web server HTTP requests and responses.tracing. You can selectively trace HTTP request and response headers and bodies via the show property in the ioto.json5 configuration file.

log: {
    show: 'hH',
    path: 'ioto.log',
    format: '%D %H %A[%P] %T %S %M',
    types: 'error,info',
    sources: 'all',
},

Setting “show” to “hH” will trace the request headers and response headers.

The “show”” property is a string set comprised of the following characters:

CharacterDescription
bShow the response body
hShow the response HTTP headers
BShow the client request HTTP body
HShow the client request HTTP headers
emptyShow no HTTP trace

You can override the ioto.json5 show property configuration via the –show Ioto command line option.

For example:

ioto --show hH

You can also override the tracing configuration via the WEB_SHOW environment variable.

Command Line OptionsEnvironment VariableDescription
–showWEB_SHOWOverride the show definition

The order of precedence of configuration is:

  1. Command line –show option value
  2. Environment variable LOG_FILTER, LOG_FORMAT values
  3. ioto.json5 configuration

In other words, the command line will override all other settings.

HTTP Client Tracing

Similar to the web server HTTP tracing, you can trace client HTTP requests and responses. Tracing HTTP client requests can be enabled via the “URL_SHOW” environment variable.

For example:

URL_SHOW=hH ioto --trace trace.log

Additional Ioto Environment Variables

You can override the Ioto trace log configuration via two environment varables: LOG_FILTER and LOG_FORMAT.

These variables take the same string values as their ioto.json5 counterparts.

The order of precedence of configuration is:

  1. Command line –trace, –debug or –verbose options
  2. Environment variable LOG_FILTER, LOG_FORMAT values
  3. ioto.json5 configuration

Release Features

Here is a more detailed list of features and fixes in the 1.4.0 release:

Release Fixes

Upgrading

This should be a simple upgrade for all users from previous 1.X releases. API compatibility is high.

Download

Go to the Builder and navigate to the Product List to download. Select a product using “Ioto” as the device agent and click the Download icon.

Ongoing Maintenance

If you have questions, please contact us at: sales@embedthis.com.

Comments

{{comment.name}} said ...

{{comment.message}}
{{comment.date}}

Make a Comment

Thank You!

Messages are moderated.

Your message will be posted shortly.

Sorry

Your message could not be processed at this time.

Error: {{error}}

Please retry later.

OK