[feat](protocol): add Protobuf schemas and code generation for hopgate streams

- Defined `hopgate_stream.proto` with message definitions for stream-based DTLS tunneling, including `Request`, `Response`, `StreamOpen`, `StreamData`, `StreamAck`, and `StreamClose`.
- Added `Envelope` container for top-level message encapsulation.
- Integrated Protobuf code generation into the `Makefile` using `protoc` with `protoc-gen-go`.
- Generated Go types under `internal/protocol/pb`.
This commit is contained in:
dalbodeule
2025-12-08 20:30:53 +09:00
parent bf5c3c8f59
commit 1fa5e900f8
3 changed files with 916 additions and 0 deletions

View File

@@ -66,3 +66,17 @@ docker-server:
@echo "Building server Docker image..."
docker build -f Dockerfile.server -t hop-gate-server:$(VERSION) .
# --- Protobuf code generation -------------------------------------------------
# Requires:
# - protoc (https://grpc.io/docs/protoc-installation/)
# - protoc-gen-go (go install google.golang.org/protobuf/cmd/protoc-gen-go@latest)
#
# Generates Go types under internal/protocol/pb from internal/protocol/hopgate_stream.proto.
proto:
@echo "Generating Go code from Protobuf schemas..."
protoc \
--go_out=. \
--go_opt=paths=source_relative \
internal/protocol/hopgate_stream.proto
@echo "Protobuf generation completed."