Asio License: Understanding the Boost Software License 1.0 Terms

The Asio C++ library is released under the Boost Software License – Version 1.0, a permissive open-source license that permits commercial and non-commercial use with minimal attribution requirements.

The Asio library authored by Chris Kohlhoff and hosted at chriskohlhoff/asio provides cross-platform C++ networking capabilities. Understanding the licensing terms is essential before integrating this header-only library into your projects. The entire codebase is governed by the Boost Software License, which imposes fewer restrictions than copyleft alternatives while ensuring proper attribution.

License File Location in the Repository

The authoritative license text resides in the repository root as LICENSE_1_0.txt. This file contains the complete legal text of the Boost Software License – Version 1.0, which applies to all source files, headers, and documentation within the chriskohlhoff/asio repository.

Boost Software License 1.0 Requirements

The Boost Software License is a permissive license that allows you to use, modify, and distribute the Asio code for both open-source and proprietary applications. Key provisions include:

  • Attribution: You must retain the original copyright notices and license text in any source or binary distribution.
  • No Warranty: The software is provided "as is" without warranty of any kind.
  • Patent Grant: The license implicitly includes a patent grant for contributors.

Unlike the GPL, the Boost license does not impose copyleft requirements, meaning you can incorporate Asio into closed-source applications without releasing your source code.

Practical Code Examples Under the Asio License

When using Asio in your projects, compliance requires maintaining the copyright notice in the source distribution. Below are typical usage patterns that comply with the Boost Software License terms.

Synchronous TCP client:

// Example 1: Basic synchronous TCP client
#include <asio.hpp>
#include <iostream>

int main() {
  try {
    asio::io_context io;
    asio::ip::tcp::resolver resolver(io);
    asio::ip::tcp::socket socket(io);

    // Resolve hostname and connect
    auto endpoints = resolver.resolve("example.com", "80");
    asio::connect(socket, endpoints);

    // Send HTTP GET request
    const std::string request = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n";
    asio::write(socket, asio::buffer(request));

    // Receive response
    for (;;) {
      char buf[512];
      std::size_t len = socket.read_some(asio::buffer(buf));
      if (len == 0) break;
      std::cout.write(buf, len);
    }
  } catch (std::exception& e) {
    std::cerr << "Error: " << e.what() << "\n";
  }
}

Asynchronous timer:

// Example 2: Asynchronous timer
#include <asio.hpp>
#include <iostream>

void on_timeout(const asio::error_code& ec) {
  if (!ec) std::cout << "Timer expired!\n";
}

int main() {
  asio::io_context io;
  asio::steady_timer timer(io, std::chrono::seconds(2));
  timer.async_wait(&on_timeout);
  io.run();
}

Both examples compile under C++11 or later and demonstrate the networking patterns permitted under the Boost Software License.

Key Files for License Compliance

When distributing applications that include Asio, ensure you include the following files from the chriskohlhoff/asio repository:

  • LICENSE_1_0.txt: The complete Boost Software License text that must accompany any distribution.
  • asio.hpp: The primary header file that pulls in the Asio core components.
  • include/asio.hpp: Alternative include path for the header-only version of the library.

Summary

  • The Asio library (chriskohlhoff/asio) uses the Boost Software License – Version 1.0.
  • The full license text is located in LICENSE_1_0.txt at the repository root.
  • This permissive license allows commercial and non-commercial use without copyleft obligations.
  • You must retain copyright notices and the license text when distributing source or binaries.
  • Asio is header-only; simply including asio.hpp or include/asio.hpp constitutes use under these terms.

Frequently Asked Questions

Is Asio free for commercial use?

Yes, the Boost Software License permits commercial use without requiring payment or royalties. You may incorporate Asio into proprietary software products, provided you include the original copyright notices and license text as specified in LICENSE_1_0.txt.

Neither. Asio is a header-only library, so there is no linking requirement. The Boost Software License applies to the source code you include in your project, regardless of whether you compile it directly into your binary or distribute it as separate files.

Where can I find the full license text in the Asio repository?

The complete license text is stored in the file LICENSE_1_0.txt in the root directory of the chriskohlhoff/asio repository. This file contains the verbatim Boost Software License – Version 1.0 text that governs all Asio source files.

Does the Boost Software License require me to contribute modifications back?

No. Unlike copyleft licenses such as the GPL, the Boost Software License does not require you to distribute your modifications or derivative works. You may keep your changes private or distribute them under any terms you choose, as long as you maintain the original Asio copyright notices and license text.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →