{"id":1069,"url":"https://github.com/xmartlabs/Xniffer","last_synced_at":"2025-07-30T20:31:05.910Z","repository":{"id":56928831,"uuid":"80836300","full_name":"xmartlabs/Xniffer","owner":"xmartlabs","description":"A swift network profiler built on top of URLSession.","archived":false,"fork":false,"pushed_at":"2017-12-09T22:55:56.000Z","size":2980,"stargazers_count":502,"open_issues_count":2,"forks_count":19,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-04-14T12:57:52.614Z","etag":null,"topics":["curl","interceptor","ios","networking","profiler","swift","swift4"],"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/xmartlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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-03T14:29:02.000Z","updated_at":"2024-04-13T08:45:50.000Z","dependencies_parsed_at":"2022-08-21T06:20:21.406Z","dependency_job_id":null,"html_url":"https://github.com/xmartlabs/Xniffer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmartlabs%2FXniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmartlabs%2FXniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmartlabs%2FXniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmartlabs%2FXniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmartlabs","download_url":"https://codeload.github.com/xmartlabs/Xniffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228179156,"owners_count":17881138,"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":["curl","interceptor","ios","networking","profiler","swift","swift4"],"created_at":"2024-01-05T20:15:38.247Z","updated_at":"2024-12-04T19:32:46.169Z","avatar_url":"https://github.com/xmartlabs.png","language":"Swift","funding_links":[],"categories":["Debugging"],"sub_categories":["Getting Started","Other free courses","Linter"],"readme":"\n\u003cimg src=\"./XnifferLogo.png\" /\u003e\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" /\u003e\n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg src=\"https://img.shields.io/badge/swift4-compatible-4BC51D.svg?style=flat\" alt=\"Swift 4 compatible\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://cocoapods.org/pods/Xniffer\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/Xniffer.svg\" alt=\"CocoaPods compatible\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://raw.githubusercontent.com/xmartlabs/Xniffer/master/LICENSE\"\u003e\u003cimg src=\"http://img.shields.io/badge/license-MIT-blue.svg?style=flat\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nBy [Xmartlabs SRL](http://xmartlabs.com).\n\n## Introduction\n\nXniffer is a non-intrusive framework for intercepting outgoing requests and their responses between your app and any external service for debugging and performance monitoring purposes.\n\n\u003ca href=\"https://github.com/netguru/ResponseDetective\"\u003e Inspired by Response detective. \u003c/a\u003e\n\n\n\u003cimg src=\"Example/fetch.gif\" width=\"300\"/\u003e\n\u003cimg src=\"Example/curl.gif\" width=\"300\"/\u003e\n\n## Setup\n\nIn order to work, the Xniffer needs to be added as a middleware between your URLSession and the Internet.\nAfter the initial setup, a window will be displayed on top of the UI that will show all the current requests and their latency.\n\n#### Basic usage\n```swift\n\nlet configuration = URLSessionConfiguration.default\n// The setup method adds the Xniffer's custom protocol as a middleware.\nXniffer.setup(with: configuration)\nlet session = URLSession(configuration: configuration)\n```\nNow we can start using this session instance for our requests!\n\n#### Using Alamofire\nIf you are using Alamofire you can start using the Xniffer by initializing your Manager with the following:\n```swift\n\nlet configuration = URLSessionConfiguration.default\nconfiguration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders\nXniffer.setup(with: configuration)\nlet sessionManager = Alamofire.SessionManager(configuration: configuration)\n```\n### UI Modes\nThe Xniffer currently supports three modes which could be used at the same time, `.window`, `.console` and `.custom`. The default value is only`.window` but this can be changed easily on the `Xniffer.setup(configuration: URLSessionConfiguration, modes: [XnifferUI] = [.window])`.\n\nEach one of this uses a different implementation of the `XnifferObserver`.\n\n  * `.window` : Displays a window on top of the status bar which can be expanded to display a list of the profiled requests. This is the default value.\n  * `.console` : Prints the results on the Xcode console.\n  * `.custom` : This one receives a closure of type `() -\u003e ()` so you can use your own implementation of the `XnifferObserver`.\n\n\n## Requirements\n\n* iOS 9.0+\n* Xcode 9.0+\n\n## Getting involved\n\n* If you **want to contribute** please feel free to **submit pull requests**.\n* If you **have a feature request** please **open an issue**.\n* If you **found a bug** or **need help** please **check older issues, [FAQ](#faq) and threads on [StackOverflow](http://stackoverflow.com/questions/tagged/Xniffer) (Tag 'Xniffer') before submitting an issue.**.\n\nBefore contribute check the [CONTRIBUTING](https://github.com/xmartlabs/Xniffer/blob/master/CONTRIBUTING.md) file for more info.\n\nIf you use **Xniffer** in your app We would love to hear about it! Drop us a line on [twitter](https://twitter.com/xmartlabs).\n\n## Examples\n\nFollow these 3 steps to run Example project: Clone Xniffer repository, open Xniffer workspace and run the *Example* project.\n## Installation\n\n#### CocoaPods\n\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects.\n\nTo install Xniffer, simply add the following line to your Podfile:\n\n```ruby\npod 'Xniffer', '~\u003e 3.0'\n```\n\n#### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a simple, decentralized dependency manager for Cocoa.\n\nTo install Xniffer, simply add the following line to your Cartfile:\n\n```ogdl\ngithub \"xmartlabs/Xniffer\" ~\u003e 3.0\n```\n\n## Author\n\n* [Mauricio Cousillas](https://github.com/mcousillas6)\n\n# Change Log\n\nThis can be found in the [CHANGELOG.md](CHANGELOG.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmartlabs%2FXniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmartlabs%2FXniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmartlabs%2FXniffer/lists"}