A lightweight, one line setup, iOS / OSX network debugging library! 🦊

Overview

Netfox: A lightweight, one line setup, network debugging library

Version CI Status Cocoapods Compatible Carthage Compatible Platform License

Netfox provides a quick look on all executed network requests performed by your iOS or OSX app. It grabs all requests - of course yours, requests from 3rd party libraries (such as AFNetworking, Alamofire or else), UIWebViews, and more

Very useful and handy for network related issues and bugs

Supports Swift 4 and above - bridged also for Objective-C.

For Swift 3.2 support, use version 1.12.1.

Feel free to contribute :)

Overview

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. To integrate netfox into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!
pod 'netfox'

To bundle only on some build configurations specify them after pod.

use_frameworks!
pod 'netfox', :configurations => ['Debug', 'Test']

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate netfox into your Xcode project using Carthage, specify it in your Cartfile:

github "kasketis/netfox"

Manually

If you prefer not to use dependency managers, you can integrate netfox into your project manually.

You can do it by copying the "netfox" folder in your project (make sure that "Create groups" option is selected)

The above folder contains 3 subfolders: Core, iOS and OSX.

  • If you target on iOS keep only Core and iOS folders (remove OSX folder)
  • If you target on OSX keep only Core and OSX folders (remove iOS folder)

Start

Swift

// AppDelegate
import netfox
NFX.sharedInstance().start() // in didFinishLaunchingWithOptions:

Objective-C

// AppDelegate
[NFX.sharedInstance start]; // in didFinishLaunchingWithOptions:

Just simple as that!

Note: Please wrap the above line with

#if DEBUG
. . .
#endif

to prevent library’s execution on your production app.

You can add the DEBUG symbol with the -DDEBUG entry. Set it in the "Swift Compiler - Custom Flags" section -> "Other Swift Flags" line in project’s "Build Settings"

Usage

Just shake your device and check what's going right or wrong! Shake again and go back to your app!

Stop

Call

NFX.sharedInstance().stop()

to stop netfox and clear all saved data. If you stop netfox its view will not be displayed until you call start method again.

If you want to just enable/disable logging functionality or clear the data please use the buttons provided in the settings view

Custom gestures

By default the library registers for shake motion. If you want to open the logs with a different gesture, add the following line after the installation one

NFX.sharedInstance().setGesture(.custom)

Then you can use

NFX.sharedInstance().show()

when you want to show the logs and

NFX.sharedInstance().hide()

when you want to hide them.

Prevent logging for specific URLs

Use the following method to prevent requests for specified URL from being logged. You can ignore as many URLs as you want

NFX.sharedInstance().ignoreURL("the_url")

Tip: You can use the url of the host (for example "https://www.github.com") to ignore all paths of it

Features

  • Search: You can easily search among requests via
    • Request url: github.com, .gr, or whatever you want
    • Request method: GET, POST, etc
    • Response type: Like json, xml, html, image and more
  • Sharing: You can share your log via email with backend devs or someone who can help.
    • Simple log option includes only request/response headers and small request/response bodies (when applicable)
    • Full log option includes request/response headers and request/response bodies (as attachments)
  • Filtering: Select what types of responses (JSON/XML/HTML/Image/Other) you want to see
  • Enable/disable logging within the app
  • Clear data within the app
  • Statistics: Check cool things like average response time, total response size and more for your selected types of responses
  • Info: Check your IP address, your app version and build number and other things within the app
  • More to come.. ;)

Integrations

Droar: A modular, single-line installation debugging window.

Other

  • If you experience any problems with request logging please check this. If you don't get your answer please open an issue
  • Due to the large size of request/response bodies, the library provides disk storage for low memory overhead

Thanks

Special thanks to tbaranes and vincedev for their contribution on OSX library!

Licence

All source code is licensed under MIT License. Which means you could do virtually anything with the code. I will appreciate it very much if you keep an attribution where appropriate.

Comments
  • OSX Support

    OSX Support

    It takes a bit more time than expected (not enough free time), but here it is: OS X support! #42

    All the features has been copy from iOS, just missing:

    • Sharing by email: not sure if that necessary since the text can be selected / copy
    • README update
    • Git history improvements (squashed all the commits?)

    We test the OS X version in our project these last days , it was working well. So, I think, it would be ok, but maybe iOS needs to be tested again (since, we moved a lot stuff).

    From now on, I'm waiting your feedback on:

    • Interfaces
    • Code architecture / conception => If you want make some change, just ask!

    Hope you will like it :)

    screen shot 2016-02-08 at 18 18 38 screen shot 2016-02-08 at 18 18 43 screen shot 2016-02-08 at 18 18 49 screen shot 2016-02-08 at 18 18 55 screen shot 2016-02-08 at 18 18 32 screen shot 2016-02-08 at 18 18 26

    opened by tbaranes 19
  • Carthage support

    Carthage support

    Hi, Very good work.

    Could you please share your schema to support carthage installation?

    https://github.com/Carthage/Carthage/blob/master/README.md#supporting-carthage-for-your-framework

    THX

    enhancement 
    opened by z4r 15
  • Integration with Alamofire in iOS 9 causes RTO

    Integration with Alamofire in iOS 9 causes RTO

    The title says it all. I tried to configure Netfox 1.11.1 with Alamofire 4.6.0 using the workarounds here, with exception of NSURLSessionConfiguration's change from defaultSessionConfiguration() to default in Swift 4.

    This issue is not apparent when I try it in iOS 9 and higher, or when I didn't call the NFX.sharedInstance().start in iOS 9. The issue still persist when I tried newer version of Alamofire.

    Does anyone have this issue too? Any help would be appreciated! 😁

    waiting 
    opened by edopelawi 13
  • OSX support

    OSX support

    Starting a first suggestion in #28 for OSX support, you seemed to be interested in it. Is there any work started yet? If no, would you be interested in a PR to handle it? (if I have the time to work on it...) Or just some helps?

    We are really interested on this since we already using Netfox in our iOS application :)

    opened by tbaranes 13
  • UIWebView does not behave as expected when netfox is enabled.

    UIWebView does not behave as expected when netfox is enabled.

    We are using a third party payment gateway. Some of the tasks (like entering credit card ) are done in a webview. When netfox was enabled website was not behaving properly (Mostly probably because javascript were not loaded properly).

    bug 
    opened by 2ank3th 12
  • Proper casing in project naming

    Proper casing in project naming

    I've noticed that this is the only framework that I use that has the framework name lowercased. @kasketis - Was this intentional? Do you mind if we update it to Netfox instead of netfox?

    enhancement 
    opened by michaelfransen 10
  • Netfox & Parse: can't see my Parse requests

    Netfox & Parse: can't see my Parse requests

    Not sure what could be the reason for that... Any idea? I see other requests (such ax Mixpanel and Facebook graph) but not Parse ones.

    But beside it - great idea and really really great and cool implematation!

    Thanks a lot!!

    opened by oferRounds 9
  • Exporting as HAR file

    Exporting as HAR file

    Looking in the email, I received the following under the request section:

    -- Body --
    
    Too long to show. If you want to see it, please tap the following button
    

    We should maybe let exporting show the full body :)

    enhancement 
    opened by Janglinator 8
  • Using Netfox without modal presentation

    Using Netfox without modal presentation

    I've created a project where I having a large selection of debugging tools built into one debugging window. Netfox is spectacular, and I'd like to add it as another section of the pod. However I don't wish to present it modally, but rather push it onto my existing navigation controller. Is there any way we could publicly expose the NFXListController class for custom usage?

    P.S. my library is in ObjC, so an @objc at the top would also be awesome!

    enhancement 
    opened by Janglinator 8
  • KFSwiftImageLoader

    KFSwiftImageLoader

    Great tool!

    Would you expect this to work with https://github.com/kiavashfaisali/KFSwiftImageLoader ?

    I'm able to see other request/responses in netfox, except for those...

    bug 
    opened by ghost 8
  • Sponsorship / Donation

    Sponsorship / Donation

    Hello, The company I work for is organizing a donation wave to support projects/teams that are doing a tremendous job helping out the open source community. Netfox it's one of these, no doubt.

    Are you open for donations/sponsorship?

    Regards.

    opened by GuilhE 7
  • By default don't print to the console and add a configuration option to set it to enabled.

    By default don't print to the console and add a configuration option to set it to enabled.

    The Problem

    Netfox pollutes the console with file not found error message for responses whose bodies aren't saved to the file system.

    Solution

    By adding configuration to enable and disable the console printing.

    opened by jz709u 0
  • Not able to search something in request or response

    Not able to search something in request or response

    Is your feature request related to a problem? Please describe. I'm not able to search in request or response, Most of the time in real world scenarios, we deal with very large network responses, and let's say we're getting some wrong data, and we want to debug that, we may know the key name, or we can try to search the incorrect value in response itself, since response is long, it's not feasible to scroll and check it line by line. Currently either have to copy the curl, run it in postman and search it there or copy the response, paste it in some text editor and search there which is very frustrating

    Describe the solution you'd like There should be a search option(atleast to response) to search something in api response

    enhancement 
    opened by PM74367 0
  • [Bug] Curls with request body don't work in postman

    [Bug] Curls with request body don't work in postman

    Describe the bug Imported curls don't work in postman when request body is present

    To Reproduce Import curl for request which contains some body Sample curl: curl "https://collector.github.com/github/collect" -X POST -H "Cache-Control: max-age=0" -H "Accept: /" -H "Origin: https://github.com" -H "Referer: https://github.com/kasketis/netfox" -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" -H "Content-Type: application/json" -d "{"body":"abc"}" Import curl in postman and try to hit, it don't work, if you go to body section of request, it shows invalid body(attached ss of body) If we change double quote in curl in data to single quote, it works fine

    Expected behavior Imported curl should work properly without any modification

    Screenshots/Video Screenshot 2022-09-10 at 12 15 13

    Enviroment: Reproducable on every environment I tried on Netfox version 1.21.0 Postman version 9.13.0

    bug 
    opened by PM74367 0
  • Any method to show specific URL request Only like ignoreURL ignore specific URL?

    Any method to show specific URL request Only like ignoreURL ignore specific URL?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    enhancement 
    opened by DipeshCoutloot 0
  • Can't see requests with Moya and Netfox version more than 1.20.0

    Can't see requests with Moya and Netfox version more than 1.20.0

    Describe the bug Can't see request with Moya and Netfox version > 1.20.0

    To Reproduce Steps to reproduce the behavior:

    1. Need use Moya and Swift 5.5
    2. Need install from pod Netfox version more > 1.20.0
    3. Enable debug mode
    4. Shake simulator or real device

    Expected behavior When we using Netfox version 1.19.0 and Moya all good!

    Enviroment:

    • Device: iOS
    • OS: 14.5, 15.0
    • Netfox version: 1.20.0 >
    • Xcode version: 13.0.
    • Swift version: 5.5
    bug 
    opened by AntonBrock 0
Releases(1.21.0)
  • 1.21.0(Mar 27, 2022)

    What's Changed

    • Added method to get session log data by @skychiarottoa in https://github.com/kasketis/netfox/pull/198
    • Fix memory leaks by invalidating session after cancelling tasks by @pauluhn in https://github.com/kasketis/netfox/pull/209
    • Refactored file storing. Other minor refactoring by @vGubriienko in https://github.com/kasketis/netfox/pull/222
    • Fixed curl export format + Embed netfox framework into demo project to run on a real device by @vGubriienko in https://github.com/kasketis/netfox/pull/225
    • Refactoring UI part by @vGubriienko in https://github.com/kasketis/netfox/pull/224
    • Fixed UI issues by @vGubriienko in https://github.com/kasketis/netfox/pull/226
    • Fixed crash when URLSessionWebSocketTask used by @vGubriienko in https://github.com/kasketis/netfox/pull/227
    • Updated logo by @vGubriienko in https://github.com/kasketis/netfox/pull/229
    • Fixed issue with macos version by @vGubriienko in https://github.com/kasketis/netfox/pull/231

    New Contributors

    • @skychiarottoa made their first contribution in https://github.com/kasketis/netfox/pull/198
    • @pauluhn made their first contribution in https://github.com/kasketis/netfox/pull/209

    Full Changelog: https://github.com/kasketis/netfox/compare/1.20.0...1.21.0

    Source code(tar.gz)
    Source code(zip)
  • 1.20.0(Dec 9, 2021)

    What's Changed

    • refactor(common): Fix indentations / Delete redundant selfs & functions by @cci-emciftci in https://github.com/kasketis/netfox/pull/169
    • make it work if embed in another pod by @tanpengsccd in https://github.com/kasketis/netfox/pull/187
    • Long press to copy request/response fail in NFXDetailsController_iOS by @bd-jhunter in https://github.com/kasketis/netfox/pull/202
    • Finishing SPM support by @vGubriienko in https://github.com/kasketis/netfox/pull/216
    • Regex ignore url support by @vGubriienko in https://github.com/kasketis/netfox/pull/217
    • Refactor, SPM support and exclude URLs based on a regex by @vGubriienko in https://github.com/kasketis/netfox/pull/220

    New Contributors

    • @cci-emciftci made their first contribution in https://github.com/kasketis/netfox/pull/169
    • @tanpengsccd made their first contribution in https://github.com/kasketis/netfox/pull/187
    • @bd-jhunter made their first contribution in https://github.com/kasketis/netfox/pull/202
    • @vGubriienko made their first contribution in https://github.com/kasketis/netfox/pull/216

    Full Changelog: https://github.com/kasketis/netfox/compare/1.19.0...1.20.0

    Source code(tar.gz)
    Source code(zip)
  • 1.19.0(Feb 11, 2020)

    What's Changed

    • add URLSessionConfiguration.ephemeral swizzling by @michaelversus in https://github.com/kasketis/netfox/pull/193

    New Contributors

    • @michaelversus made their first contribution in https://github.com/kasketis/netfox/pull/193

    Full Changelog: https://github.com/kasketis/netfox/compare/1.18.0...1.19.0

    Source code(tar.gz)
    Source code(zip)
  • 1.16.0(Jul 22, 2019)

    What's Changed

    • Add view controller for viewing query string params (if any) upon cli… by @tzatzosm in https://github.com/kasketis/netfox/pull/165

    New Contributors

    • @tzatzosm made their first contribution in https://github.com/kasketis/netfox/pull/165

    Full Changelog: https://github.com/kasketis/netfox/compare/1.15.1...1.16.0

    Source code(tar.gz)
    Source code(zip)
  • 1.12.1(Sep 14, 2018)

  • 1.10.3(Oct 18, 2017)

    What's Changed

    • Added an iOS demo by @Janglinator in https://github.com/kasketis/netfox/pull/93
    • True one-line installation using Swizzling by @Janglinator in https://github.com/kasketis/netfox/pull/94
    • Fix various Xcode 9 issues not allowing compilation by @freak4pc in https://github.com/kasketis/netfox/pull/99

    Full Changelog: https://github.com/kasketis/netfox/compare/1.10.2...1.10.3

    Source code(tar.gz)
    Source code(zip)
  • 1.10.2(Oct 14, 2017)

  • 1.10.1(Oct 13, 2017)

    What's Changed

    • Fix macOS podspec by @tbaranes in https://github.com/kasketis/netfox/pull/72
    • [swift3] Fixed crash due force unwrap of wrong dictionary type by @adelinofaria in https://github.com/kasketis/netfox/pull/77
    • Updated the workaround to Swift 3 by @Abeansits in https://github.com/kasketis/netfox/pull/81
    • fixes downcast warning in swift 3 by @twobitlabs in https://github.com/kasketis/netfox/pull/86
    • Support JSON API headers (application/vnd.api+json) by @freak4pc in https://github.com/kasketis/netfox/pull/89
    • Added long press gesture to copy debug texts. by @freak4pc in https://github.com/kasketis/netfox/pull/90
    • Animated transfer between Info Views + Swipe gestures by @freak4pc in https://github.com/kasketis/netfox/pull/91
    • Added left close button in NFXListController_iOS + NFX.toggle() by @freak4pc in https://github.com/kasketis/netfox/pull/92

    New Contributors

    • @tbaranes made their first contribution in https://github.com/kasketis/netfox/pull/72
    • @Abeansits made their first contribution in https://github.com/kasketis/netfox/pull/81

    Full Changelog: https://github.com/kasketis/netfox/compare/1.7.2...1.10.1

    Source code(tar.gz)
    Source code(zip)
  • 1.9(Oct 12, 2017)

    What's Changed

    • Fix macOS podspec by @tbaranes in https://github.com/kasketis/netfox/pull/72
    • [swift3] Fixed crash due force unwrap of wrong dictionary type by @adelinofaria in https://github.com/kasketis/netfox/pull/77

    New Contributors

    • @tbaranes made their first contribution in https://github.com/kasketis/netfox/pull/72

    Full Changelog: https://github.com/kasketis/netfox/compare/1.7.2...1.9

    Source code(tar.gz)
    Source code(zip)
  • 1.8(Jun 27, 2016)

  • 1.7.2(Jan 18, 2016)

  • 1.7.1(Jan 8, 2016)

  • 1.7(Dec 1, 2015)

  • 1.6(Dec 1, 2015)

  • 1.5.5(Nov 30, 2015)

  • 1.5.4(Nov 30, 2015)

  • 1.5.3(Nov 30, 2015)

  • 1.5.1(Nov 30, 2015)

  • 1.5(Nov 29, 2015)

  • 1.4.2(Nov 29, 2015)

  • 1.4.1(Nov 28, 2015)

  • 1.4(Nov 28, 2015)

  • 1.3.4(Nov 28, 2015)

  • 1.3.3(Nov 28, 2015)

  • 1.3.2(Nov 27, 2015)

  • 1.3.1(Nov 27, 2015)

  • 1.3(Nov 27, 2015)

  • 1.2.1(Nov 27, 2015)

  • 1.2(Nov 26, 2015)

  • 1.1.2(Nov 26, 2015)

Owner
Christos Kasketis
Curious about how things work.
Christos Kasketis
Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Igor 2 Sep 16, 2022
Digger is a lightweight download framework that requires only one line of code to complete the file download task

中文说明 Digger is a lightweight download framework that requires only one line of code to complete the file download task. Based on URLSession, pure Swif

Ant 543 Oct 29, 2022
NWReachability - a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

NWReachability is a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

null 4 Dec 2, 2022
Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage

Ronan Rodrigo Nunes 89 Dec 26, 2022
A network extension app to block a user input URI. Meant as a network extension filter proof of concept.

URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to

Charles Edge 5 Oct 17, 2022
Say goodbye to the Fat ugly singleton Network Manager with this Network Layer

MHNetwork Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager Philosophy the main philosophy behind MHNetwork is to h

Mohamed Emad Hegab 19 Nov 19, 2022
Setup your class structure in Xcode Interface Builder and save() in Parse Server.

ISParseBind With ISParseBind you can save, update and query PFObjects using the power of Xcode Interface Builder resources. https://www.youtube.com/wa

Weni 10 Mar 28, 2022
A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking.

XMNetworking English Document XMNetworking 是一个轻量的、简单易用但功能强大的网络库,基于 AFNetworking 3.0+ 封装。 其中,XM 前缀是我们团队 Xcode-Men 的缩写。 简介 如上图所示,XMNetworking 采用中心化的设计思想

KANGZUBIN 981 Dec 29, 2022
Lightweight network abstraction layer, written on top of Alamofire

TRON is a lightweight network abstraction layer, built on top of Alamofire. It can be used to dramatically simplify interacting with RESTful JSON web-

MLSDev 528 Dec 26, 2022
SwiftyReachability is a simple and lightweight network interface manager written in Swift.

SwiftyReachability is a simple and lightweight network interface manager written in Swift. Freely inspired by https://github.com/tonymillion/Reachabil

Antonio Guerra 5 Nov 4, 2022
Conforming WebSocket (RFC 6455) client library for iOS and Mac OSX

SwiftWebSocket Conforming WebSocket (RFC 6455) client library for iOS and Mac OS

null 0 Dec 24, 2021
SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN.

SwiftCANLib SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN. Th

Tim Wise 4 Oct 25, 2021
Websockets in swift for iOS and OSX

Starscream is a conforming WebSocket (RFC 6455) library in Swift. Features Conforms to all of the base Autobahn test suite. Nonblocking. Everything ha

Dalton 7.5k Jan 4, 2023
Fast Websockets in Swift for iOS and OSX

SwiftWebSocket Conforming WebSocket (RFC 6455) client library for iOS and Mac OSX. SwiftWebSocket passes all 521 of the Autobahn's fuzzing tests, incl

Josh 1.5k Dec 28, 2022
WKZombie is an iOS/OSX web-browser without a graphical user interface.

WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript.

Mathias Köhnke 1.1k Dec 16, 2022
Socket.io iOS and OSX Client compatible with v1.0 and later

SocketIO-Kit ⚠️ This project is no longer maintained. Please use the official framework Socket.IO-Client-Swift. SocketIO-Kit is a Socket.io iOS client

Ricardo Pereira 140 Mar 9, 2022
Easy-to-use ICMP Ping for iOS (and maybe OSX)

CDZPinger Easy-to-use ICMP ping for iOS - just create a CDZPinger and you delegate gets a callback every second with the average ping time. Installati

Chris Dzombak 48 Feb 2, 2022
An iOS LAN Network Scanner library

MMLanScan MMLanScan is an open source project for iOS that helps you scan your network and shows the available devices and their MAC Address, hostname

Michael Mavris 459 Dec 11, 2022
A light weight network library with automated model parser for rapid development

Gem A light weight network library with automated model parser for rapid development. Managing all http request with automated model parser calls in a

Albin CR 10 Nov 19, 2022