InjectURLProtocol
cycript script for injecting a custom NSURLProtocol into a running application
Install / Use
/learn @keith/InjectURLProtocolREADME
injectURLProtocol
This is a simple cycript script for injecting a custom
NSURLProtocol that logs every HTTP request.
Installation
Install cycript. If you'd like to use homebrew instead you can use my tap with:
$ brew install keith/formulae/cycript
Then copy injectURLProtocol.cy to somewhere you can reference it.
Usage
Run the script in the process in question:
$ cycript -p APPLICATION injectURLProtocol.cy
Then open Console.app to see messages formatted like this:
1/1/70 00:00:00.000 Slack[83206]: Req: POST https://slack.com/api/api.test?error= Headers: {
"Content-Type" = "application/x-www-form-urlencoded";
Origin = "file://";
"User-Agent" = "...";
}
NOTE: To make it easier to just see these requests, you can filter
by searching for Req:
Alternatives
Depending on what else you're doing with cycript, you might actually be
better off using CFNETWORK_DIAGNOSTICS which can provide
similar functionality without any addition configuration. You can simple
using this environment variable when launching the binary in question
like this:
$ CFNETWORK_DIAGNOSTICS=3 path/to/binary
Warning
This script could print sensitive information into your console. Be careful out there!
Related Skills
node-connect
337.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
