{"id":41315945,"url":"https://github.com/negasus/haproxy-spoe-go","last_synced_at":"2026-01-23T05:31:23.872Z","repository":{"id":45379398,"uuid":"188216670","full_name":"negasus/haproxy-spoe-go","owner":"negasus","description":"Haproxy SPOE (Stream Processing Offload Engine) Agent Golang implementation","archived":false,"fork":false,"pushed_at":"2025-08-18T14:30:41.000Z","size":53,"stargazers_count":46,"open_issues_count":3,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-18T16:22:53.394Z","etag":null,"topics":["go","golang","haproxy","middleware","spoa","spoe"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/negasus.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-23T10:58:30.000Z","updated_at":"2025-08-18T14:30:24.000Z","dependencies_parsed_at":"2024-06-18T19:49:34.233Z","dependency_job_id":"2847324a-fdd2-4290-be5a-3025374be691","html_url":"https://github.com/negasus/haproxy-spoe-go","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/negasus/haproxy-spoe-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negasus%2Fhaproxy-spoe-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negasus%2Fhaproxy-spoe-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negasus%2Fhaproxy-spoe-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negasus%2Fhaproxy-spoe-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negasus","download_url":"https://codeload.github.com/negasus/haproxy-spoe-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negasus%2Fhaproxy-spoe-go/sbom","scorecard":{"id":385032,"data":{"date":"2025-08-11","repo":{"name":"github.com/negasus/haproxy-spoe-go","commit":"042087dff4f1b4e025cb725704e1cef9e49b1ac6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":5,"reason":"Found 10/18 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/negasus/haproxy-spoe-go/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/negasus/haproxy-spoe-go/test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T16:23:42.180Z","repository_id":45379398,"created_at":"2025-08-18T16:23:42.180Z","updated_at":"2025-08-18T16:23:42.180Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28680748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T04:33:33.518Z","status":"ssl_error","status_checked_at":"2026-01-23T04:33:30.433Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","haproxy","middleware","spoa","spoe"],"created_at":"2026-01-23T05:31:22.442Z","updated_at":"2026-01-23T05:31:23.859Z","avatar_url":"https://github.com/negasus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Haproxy SPOE Golang Agent Library [![Go Report Card](https://goreportcard.com/badge/github.com/negasus/haproxy-spoe-go)](https://goreportcard.com/report/github.com/negasus/haproxy-spoe-go) ![](https://github.com/negasus/haproxy-spoe-go/workflows/Test/badge.svg)\n\nTerms from [Haproxy SPOE specification](https://www.haproxy.org/download/1.9/doc/SPOE.txt)\n\n```\n* SPOE : Stream Processing Offload Engine.\n\n    A SPOE is a filter talking to servers managed ba a SPOA to offload the\n    stream processing. An engine is attached to a proxy. A proxy can have\n    several engines. Each engine is linked to an agent and only one.\n\n* SPOA : Stream Processing Offload Agent.\n\n    A SPOA is a service that will receive info from a SPOE to offload the\n    stream processing. An agent manages several servers. It uses a backend to\n    reference all of them. By extension, these servers can also be called\n    agents.\n\n* SPOP : Stream Processing Offload Protocol, used by SPOEs to talk to SPOA\n         servers.\n\n    This protocol is used by engines to talk to agents. It is an in-house\n    binary protocol described in this documentation.\n```\n\n\nThis library implements SPOA for Golang applications\n\n## Install\n\n```\ngo get -u github.com/negasus/haproxy-spoe-go\n```\n\n## Example\n\nExample from Section 2.5 [SPOE specification](https://www.haproxy.org/download/1.9/doc/SPOE.txt) describes a simple IP reputation service.\n\n\u003e Here is a simple but complete example that sends client-ip address to a ip\n  reputation service. This service can set the variable \"ip_score\" which is an\n  integer between 0 and 100, indicating its reputation (100 means totally safe\n  and 0 a blacklisted IP with no doubt).\n\nGolang backend application for this example\n\n```go\npackage main\n\nimport (\n\t\"github.com/negasus/haproxy-spoe-go/action\"\n\t\"github.com/negasus/haproxy-spoe-go/agent\"\n\t\"github.com/negasus/haproxy-spoe-go/request\"\n        \"github.com/negasus/haproxy-spoe-go/logger\"\n\t\"log\"\n\t\"math/rand\"\n\t\"net\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tlog.Print(\"listen 3000\")\n\n\tlistener, err := net.Listen(\"tcp4\", \"127.0.0.1:3000\")\n\tif err != nil {\n\t\tlog.Printf(\"error create listener, %v\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer listener.Close()\n\n\ta := agent.New(handler, logger.NewDefaultLog())\n\n\tif err := a.Serve(listener); err != nil {\n\t\tlog.Printf(\"error agent serve: %+v\\n\", err)\n\t}\n}\n\nfunc handler(req *request.Request) {\n\n\tlog.Printf(\"handle request EngineID: '%s', StreamID: '%d', FrameID: '%d' with %d messages\\n\", req.EngineID, req.StreamID, req.FrameID, req.Messages.Len())\n\n\tmessageName := \"get-ip-reputation\"\n\n\tmes, err := req.Messages.GetByName(messageName)\n\tif err != nil {\n\t\tlog.Printf(\"message %s not found: %v\", messageName, err)\n\t\treturn\n\t}\n\n\tipValue, ok := mes.KV.Get(\"ip\")\n\tif !ok {\n\t\tlog.Printf(\"var 'ip' not found in message\")\n\t\treturn\n\t}\n\n\tip, ok := ipValue.(net.IP)\n\tif !ok {\n\t\tlog.Printf(\"var 'ip' has wrong type. expect IP addr\")\n\t\treturn\n\t}\n\n\tipScore := rand.Intn(100)\n\n\tlog.Printf(\"IP: %s, send score '%d'\", ip.String(), ipScore)\n\n\treq.Actions.SetVar(action.ScopeSession, \"ip_score\", ipScore)\n}\n```\n\n## API\n\n### Messages\n\nGetting request data is possible through `Request.Messages`\n\n#### Len() int\n\nReturns count of messages in request\n\n```\ncount := request.Messages.Len()\n```\n\n#### GetByName(name string) (*Message, error)\n\nReturns message by name and error if not exists\n\n```\nmes, err := request.Messages.GetByName(\"get-ip-reputation\")\n```\n\n#### GetByIndex(idx int) (*Message, error)\n\nReturns message by index and error if not exists\n\n```\nmes, err := request.Messages.GetByIndex(0)\n```\n\n### Message\n\nRepresents one message, sent by Haproxy\n\nMessage has two fields\n- Name string\n- KV   *kv.KV\n\nKV contains key-value data of message\n\n### Actions\n\nActions is used for sending a response to Haproxy\n\n#### SetVar(scope Scope, name string, value interface{})\n\nSet variable with `name` to `value` in specific `scope` (see bellow)\n\n```\nrequest.Actions.SetVar(action.ScopeSession, \"ip_score\", 10)\n```\n\n#### UnsetVar(scope Scope, name string)\n\nUnset variable with `name` in specific `scope`\n\n```\nrequest.Actions.UnsetVar(action.ScopeSession, \"ip_score\")\n```\n\n#### Actions Scopes\n- ScopeProcess\n- ScopeSession\n- ScopeTransaction\n- ScopeRequest\n- ScopeResponse\n\n### KV (key-value)\n\nContains message key-value data sent by Haproxy\n\n#### Get(key string) (interface{}, bool)\n\nReturns value by name. If key doesn't exist, last returned value will be set to False\n\n```\nipValue, ok := message.KV.Get(\"ip\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegasus%2Fhaproxy-spoe-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegasus%2Fhaproxy-spoe-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegasus%2Fhaproxy-spoe-go/lists"}