{"id":13826540,"url":"https://github.com/kofktu/sniffer","last_synced_at":"2025-03-17T00:32:55.134Z","repository":{"id":62455734,"uuid":"82022918","full_name":"Kofktu/Sniffer","owner":"Kofktu","description":"Networking activity logger for Swift","archived":false,"fork":false,"pushed_at":"2020-12-29T03:41:37.000Z","size":244,"stargazers_count":121,"open_issues_count":1,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-24T13:20:20.555Z","etag":null,"topics":["debugging","ios","logger","macos","network-monitoring","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Kofktu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T05:15:07.000Z","updated_at":"2024-04-23T01:18:58.000Z","dependencies_parsed_at":"2022-11-02T00:01:26.912Z","dependency_job_id":null,"html_url":"https://github.com/Kofktu/Sniffer","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofktu%2FSniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofktu%2FSniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofktu%2FSniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofktu%2FSniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kofktu","download_url":"https://codeload.github.com/Kofktu/Sniffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669427,"owners_count":16860874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["debugging","ios","logger","macos","network-monitoring","swift","tvos","watchos"],"created_at":"2024-08-04T09:01:39.990Z","updated_at":"2024-10-27T11:36:15.213Z","avatar_url":"https://github.com/Kofktu.png","language":"Swift","funding_links":[],"categories":["\u003ca id=\"7bf0f5839fb2827fdc1b93ae6ac7f53d\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"32739127f0c38d61b14448c66a797098\"\u003e\u003c/a\u003e嗅探\u0026\u0026Sniff"],"readme":"# Sniffer\n\n[![Build Status](https://travis-ci.org/Kofktu/Sniffer.svg?branch=master)](https://travis-ci.org/Kofktu/Sniffer)\n![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)\n[![Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/)\n[![CocoaPods](http://img.shields.io/cocoapods/v/Sniffer.svg?style=flat)](http://cocoapods.org/?q=name%3ASniffer%20author%3AKofktu)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)\n\n- Automatic networking activity logger\n- intercepting any outgoing requests and incoming responses for debugging purposes.\n\n![alt tag](Screenshot/Sample.png)\n\n## Requirements\n- iOS 8.0+, macOS 10.9+, watchOS 2.0+, tvOS 9.0+\n- Swift 5.0\n- Swift 4.2 ([1.7.0](https://github.com/Kofktu/Sniffer/tree/1.7.0))\n- Swift 4.0 ([1.5.0](https://github.com/Kofktu/Sniffer/tree/1.5.0))\n- Swift 3.0 ([1.0.6](https://github.com/Kofktu/Sniffer/tree/1.0.6))\n\n## Example\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Installation\n\n#### CocoaPods\nSniffer is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"Sniffer\", '~\u003e 2.0'\n```\n\n#### Carthage\nFor iOS 8+ projects with [Carthage](https://github.com/Carthage/Carthage)\n\n```\ngithub \"Kofktu/Sniffer\"\n```\n\n## Usage\n\n#### for any requests you make via 'URLSession'\n\n```swift\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n  Sniffer.register() // Register Sniffer to log all requests\n  return true\n}\n```\n\n#### for URLSessionConfiguration\n\n```swift\nlet configuration = URLSessionConfiguration.default\nSniffer.enable(in: configuration)\n```\n\n#### for Custom Deserializer\n\n```swift\npublic protocol BodyDeserializer {\n    func deserialize(body: Data) -\u003e String?\n}\n\npublic final class CustomTextBodyDeserializer: BodyDeserializer {\n    public func deserialize(body: Data) -\u003e String? {\n        // customization\n        return String?\n    }\n}\n\nSniffer.register(deserializer: CustomTextBodyDeserializer(), for: [\"text/plain\"])\n\n```\n\n#### If you want to process the logs directly in your application\n\n```swift\n// Register the handler if you want the log to be handled directly by the application\nSniffer.onLogger = { (url, log) in\n  print(\"\\(url) : \\(log)\")\n}\n```\n\n#### If you want to ignore domains\n```swift\nSniffer.ignore(domains: [\"github.com\"])\n```\n\n## References\n- Timberjack (https://github.com/andysmart/Timberjack)\n- ResponseDetective (https://github.com/netguru/ResponseDetective)\n\n## Authors\n\nTaeun Kim (kofktu), \u003ckofktu@gmail.com\u003e\n\n## License\n\nSniffer is available under the ```MIT``` license. See the ```LICENSE``` file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkofktu%2Fsniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkofktu%2Fsniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkofktu%2Fsniffer/lists"}