Skip to content
/ qicap Public

A minimal working ICAP server and client implementation in Go

License

Notifications You must be signed in to change notification settings

iamgaru/qicap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICAP Server & Client in Go

A minimal working ICAP server and client implementation in Go, designed for testing RESPMOD (response modification) use cases like keyword-based content filtering.


🧰 Features

  • Supports RESPMOD (response modification)
  • Parses full ICAP and embedded HTTP payloads
  • Blocks responses with banned keywords like drugs, sex, violence
  • Returns 403 Forbidden when content matches, or 204 No Content otherwise
  • Includes a CLI test client that sends an ICAP RESPMOD request with an embedded HTTP response

🚀 Getting Started

🛠 Requirements

  • Go 1.18+
  • No dependencies or external libraries

▶️ Running the Server

go run icap-server.go

You should see:

ICAP server running on :1344

💬 Testing the Server

Create a test payload (that should be blocked):

echo "this contains drugs" > test.txt

Run the client:

go run icap-client.go localhost:1344 /respmod test.txt

Expected output:

ICAP/1.0 200 OK
Encapsulated: res-hdr=0, res-body=75

HTTP/1.1 403 Forbidden
Content-Type: text/plain

Blocked by ICAP filter.

Clean text test:

echo "hello world" > test.txt
go run icap-client.go localhost:1344 /respmod test.txt

Expected output:

ICAP/1.0 204 No Content
Encapsulated: null-body=0

About

A minimal working ICAP server and client implementation in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages