All Projects → Kofktu → Sniffer

Kofktu / Sniffer

Licence: mit
Networking activity logger for Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Sniffer

Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+3335.19%)
Mutual labels:  tvos, watchos, debugging
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+3389.81%)
Mutual labels:  network-monitoring, logger, debugging
Egocache
Fast Caching for Objective-C (iPhone & Mac Compatible)
Stars: ✭ 1,339 (+1139.81%)
Mutual labels:  tvos, watchos
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+1025.93%)
Mutual labels:  tvos, watchos
Sdwebimagewebpcoder
A WebP coder plugin for SDWebImage, use libwebp
Stars: ✭ 101 (-6.48%)
Mutual labels:  tvos, watchos
Articles
Articles for NSHipster.com
Stars: ✭ 1,166 (+979.63%)
Mutual labels:  tvos, watchos
Mothership
iTunes Connect Library inspired by FastLane
Stars: ✭ 72 (-33.33%)
Mutual labels:  tvos, watchos
React Native Logs
Performance-aware simple logger for React-Native with namespaces, custom levels and custom transports (colored console, file writing, etc.)
Stars: ✭ 84 (-22.22%)
Mutual labels:  logger, debugging
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects
Stars: ✭ 8,419 (+7695.37%)
Mutual labels:  tvos, watchos
Extendable
Blocks Based Bluetooth LE Connectivity framework for iOS/watchOS/tvOS/OSX. Quickly configure centrals & peripherals, perform read/write operations, and respond characteristic updates.
Stars: ✭ 88 (-18.52%)
Mutual labels:  tvos, watchos
Activityrings
An attempt to recreate the ring controls in Apple’s Activity app
Stars: ✭ 88 (-18.52%)
Mutual labels:  tvos, watchos
Prex
🔁Unidirectional data flow architecture with MVP and Flux combination for Swift
Stars: ✭ 102 (-5.56%)
Mutual labels:  tvos, watchos
Predicateflow
Write amazing, strong-typed and easy-to-read NSPredicate.
Stars: ✭ 98 (-9.26%)
Mutual labels:  tvos, watchos
Waterfallgrid
A waterfall grid layout view for SwiftUI.
Stars: ✭ 1,086 (+905.56%)
Mutual labels:  tvos, watchos
Awesome Rubymotion
A collection of awesome RubyMotion example apps, libraries, tools, frameworks, software and resources
Stars: ✭ 103 (-4.63%)
Mutual labels:  tvos, watchos
Ios Sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 56 (-48.15%)
Mutual labels:  network-monitoring, logger
Host.swift
*Host.swift is no longer maintained*, please use Hostess.swift: https://github.com/rjstelling/Hostess.swift. A Swift implementation of NSHost that works on iOS, OS X and tvOS. Host.swift is safe to use in a framework because it does not require a bridging header.
Stars: ✭ 83 (-23.15%)
Mutual labels:  tvos, watchos
Mixpanel
Unofficial Swift Mixpanel client
Stars: ✭ 93 (-13.89%)
Mutual labels:  tvos, watchos
Sqlitelib
Easily build a custom SQLite static library for use in macOS and iOS frameworks and apps.
Stars: ✭ 38 (-64.81%)
Mutual labels:  tvos, watchos
Fugen
Command line tool for exporting resources and generating code from your Figma files
Stars: ✭ 41 (-62.04%)
Mutual labels:  tvos, watchos

Sniffer

Build Status Swift Platform CocoaPods Carthage compatible SwiftPM compatible

  • Automatic networking activity logger
  • intercepting any outgoing requests and incoming responses for debugging purposes.

alt tag

Requirements

  • iOS 8.0+, macOS 10.9+, watchOS 2.0+, tvOS 9.0+
  • Swift 5.0
  • Swift 4.2 (1.7.0)
  • Swift 4.0 (1.5.0)
  • Swift 3.0 (1.0.6)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

CocoaPods

Sniffer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Sniffer", '~> 2.0'

Carthage

For iOS 8+ projects with Carthage

github "Kofktu/Sniffer"

Usage

for any requests you make via 'URLSession'

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  Sniffer.register() // Register Sniffer to log all requests
  return true
}

for URLSessionConfiguration

let configuration = URLSessionConfiguration.default
Sniffer.enable(in: configuration)

for Custom Deserializer

public protocol BodyDeserializer {
    func deserialize(body: Data) -> String?
}

public final class CustomTextBodyDeserializer: BodyDeserializer {
    public func deserialize(body: Data) -> String? {
        // customization
        return String?
    }
}

Sniffer.register(deserializer: CustomTextBodyDeserializer(), for: ["text/plain"])

If you want to process the logs directly in your application

// Register the handler if you want the log to be handled directly by the application
Sniffer.onLogger = { (url, log) in
  print("\(url) : \(log)")
}

If you want to ignore domains

Sniffer.ignore(domains: ["github.com"])

References

Authors

Taeun Kim (kofktu), [email protected]

License

Sniffer is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].