Skip to content

Add C++ TCP server foundation for HTTP protocol implementation#3

Draft
Copilot wants to merge 5 commits intofeat/cpp-tcp-to-http-modulefrom
copilot/create-tcp-to-http-module
Draft

Add C++ TCP server foundation for HTTP protocol implementation#3
Copilot wants to merge 5 commits intofeat/cpp-tcp-to-http-modulefrom
copilot/create-tcp-to-http-module

Conversation

Copy link

Copilot AI commented Jan 17, 2026

Initial TCP server implementation in C++ with Bazel and GoogleTest, providing the foundation for HTTP protocol development in the Helix server framework.

Implementation

C++ TCP Library (packages/tcp/)

  • create_server(address, port) factory function returning std::unique_ptr<TcpServer>
  • POSIX socket implementation with bind, listen, and lifecycle management
  • SO_REUSEADDR for development convenience

Build System

  • Bazel workspace with GoogleTest integration
  • Makefile alternative for rapid iteration
  • C++17 standard with smart pointers throughout

Testing

  • 9 GoogleTest unit tests covering configuration, lifecycle, and error cases
  • Manual test program for quick verification

Usage

#include "tcp_server.hpp"

auto server = helix::tcp::create_server("127.0.0.1", 8080);
if (server->start()) {
    // Server listening on TCP socket
    // Ready for HTTP protocol layer
    server->stop();
}

Next steps: connection handling, HTTP request parsing, and Node.js/Bun addon export.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • releases.bazel.build
    • Triggering command: /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 build //packages/tcp:tcp_server (dns block)
  • www.googleapis.com
    • Triggering command: /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 build //packages/tcp:tcp_server (dns block)
    • Triggering command: /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 --version (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

I need you to create the initial steps for this tcp to http module. We are using the Bun server to listen to new connections. The goal of this C++ library is to create the necessary tools for HTTP servers as they want, first starting with a TCP implementation, and to finally create the http protocol.

the goal is to expose a function createServer from cpp (create_server) that receives for now just address and port, this function will be exported as an addon to compabilice bun a node, but for now lets keep the function only in cpp, keep in mind to use .cc files and .hpp or .h headers files, for building and testing lets use bazel and google c++ unit testing library.

All the implementations must live in the packages/tcp folder.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@itssimmons itssimmons self-requested a review January 17, 2026 16:39
@itssimmons itssimmons added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 17, 2026
Copilot AI and others added 4 commits January 17, 2026 16:47
Co-authored-by: itssimmons <62354548+itssimmons@users.noreply.github.com>
Co-authored-by: itssimmons <62354548+itssimmons@users.noreply.github.com>
Co-authored-by: itssimmons <62354548+itssimmons@users.noreply.github.com>
Co-authored-by: itssimmons <62354548+itssimmons@users.noreply.github.com>
Copilot AI changed the title [WIP] Add initial steps for TCP to HTTP module Add C++ TCP server foundation for HTTP protocol implementation Jan 17, 2026
@itssimmons
Copy link
Contributor

itssimmons commented Jan 18, 2026

Can you please explain how to run this implementation in the command-line @copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants