Code Monkey home page Code Monkey logo

wormholy's Introduction

Icon

Language Pod version Carthage Compatible

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable.

What you can do:

  • No code to write and no imports.
  • Record all app traffic that uses NSURLSession.
  • Reveal the content of all requests, responses, and headers simply by shaking your phone!
  • No headaches with SSL certificates on HTTPS calls.
  • Find, isolate and fix bugs quickly.
  • Swift & Objective-C compatibility.
  • Also works with external libraries like Alamofire & AFNetworking.
  • Ability to blacklist hosts from being recorded using the array ignoredHosts.
  • Ability to export API requests as Postman collection
  • Ability to share cURL rappresentation of API requests

Icon

Requirements


  • iOS 11.0+
  • Xcode 10+
  • Swift 4, 4.1, 4.2 and Swift 5

Usage


Add it to your project, and that's all! Shake your device or your simulator and Wormholy will appear! You don't need to import the library into your code, it works magically!

I suggest you install it only in debug mode. The easiest way is with CocoaPods:

pod 'Wormholy', :configurations => ['Debug']

If you want to disable the shake, and fire Wormholy from another point inside your app, you need to set the environment variable WORMHOLY_SHAKE_ENABLED = NO, and call this local notification:

NotificationCenter.default.post(name: NSNotification.Name(rawValue: "wormholy_fire"), object: nil)

You can also programmatically enable/disable the shake gesture at any time. You can do Wormholy.shakeEnabled = false to disable (or enable) the shake gesture.

Carthage


You can also install Wormholy using Carthage.

To integrate Wormholy into your Xcode project using Carthage, specify it in your Cartfile:

github "pmusolino/Wormholy"

Run carthage update to build the framework and drag the built Wormholy.framework into your Xcode project.

Contributing

  • If you need help or you'd like to ask a general question, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Acknowledgements

Made with โค๏ธ by Paolo Musolino.

Follow me on:

๐Ÿ’ผ Linkedin

๐Ÿค– Twitter

๐ŸŒ‡ Instagram

๐Ÿ‘จ๐Ÿผโ€๐ŸŽค Facebook

MIT License


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

wormholy's People

Contributors

99arobe avatar alwold avatar andersio avatar ashton-w avatar colinhumber avatar davedelong avatar dingtianran avatar farktronix avatar gmoraleda avatar javikr avatar kapoorsahil avatar kealdishx avatar neilkimmett avatar pedro-cid avatar percivalwcy avatar pmusolino avatar rickirby avatar sagarsdagdu avatar smarttuner avatar wotjd avatar yawillianpsb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wormholy's Issues

CocoaPods can not find specification

Hi there,

I'm trying to use the library via CocoaPods but it gives the error below.

[!] Unable to find a specification for Wormholy

Maybe something got broken in latest version of .podspec file.

Thnx already.

Memory leak

Currently, I'm experiencing a spike of memory leaks on my graph every time I use the pod. Thoughts about it?

Group

Wormholy is re-enabled when referencing default or ephemeral session configs after being previously disabling

If I call the Wormholy.enable(_:sessionConfiguration:) to disable logging of network traffic on either the URLSessionConfiguration.default or URLSessionConfiguration.ephemeral, the next time either of those configurations are referenced, Wormholy will re-enable logging for those configurations as the swizzled accessors in NSURLSessionConfiguration+Wormholy automatically enable logging.

As of now, I'm not really sure how to completely disable logging without completely removing the framework.

I want to integrate to custom schemes

I have 4 schemes in my project except Release and I want to integrate in all the schemes except Release version.

Can anyone please explain the steps required to achieve my requirement?

Thanks in advance

Allow sharing whole network session and whole request

Quickly skimming through code I didn't fine anything indicating that this is currently possible and screenshots in README also prove that. Would be nice to be able to share not just individual screenshots but the whole network session, in a for of archive probably. As well as individual request completely, not just its body and response body.
I'm cloning the project now to see if I can add this.
Looking forward to integrate this in my current project!

Capture output to an external service

I have an idea to be able to capture the i/o of the networking stack and to share it automatically to some server. Or, at least, be able to share all the captured information as archive.

Getting Swift Compiler Errors

After Installing pod, getting swift compiler errors in following files :

CodeAttributesString.swift
Highlighter.swift
RequestModelBeautifier.swift
Theme.swift

Error : Method does not override any method from its super class

Swift version 3.3

Increase numbers of lines at RequestCell

Hi
I'd like to offer you increase the number of lines for the urlLabel at the RequestCell since it's impossible to see the full path of a request if the host is quite long.

[Feature Request] Exclude URLs from caching response data

It would be nice to be able to tell Wormholy which URLs to ignore from saving response data to memory.
We use it in our current project and we were downloading some big files, until we realized that Wormholy was storing that data in memory for the request history. We kept Wormholy but had to tweak it to avoid this (CustomHTTPProtocol.swift file, urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) function implementation).

It would be ideal to have this array of URL to ignore (or in fact, URL regex to ignore), and maybe if it's useful for someone, URL to ignore completely (request and response).

`wormholy_fire` notification doesn't work

The current way of invoking Wormholy mentioned in the documentation doesn't work:

NotificationCenter.default.post(name: NSNotification.Name(rawValue: "wormholy_fire"), object: nil)

Please update wormholy_fire -> wormholy_shake.

Memory leak

Currently I'm experiencing a spike of memory leaks on my graph every time I use the pod. Thoughts about it?

captura de pantalla 2018-11-04 a la s 13 52 49

Need help

I think you probably forgot about your other project PMAlertController, and since you are apparently active here I'm asking you here to please respond to my latest comment on this issue.

Thanks.

Integer Overflow Issue when Uploading a file

In the method:
private func body(from request: URLRequest) -> Data? { return request.httpBody ?? request.httpBodyStream.flatMap { stream in let data = NSMutableData() stream.open() while stream.hasBytesAvailable { var buffer = [UInt8](repeating: 0, count: 1024) let length = stream.read(&buffer, maxLength: buffer.count) data.append(buffer, length: length) } stream.close() return data as Data } }
In the row "data.append(buffer, length: length)"

I'm getting a crash, when my app is uploading a chunk of data:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSConcreteMutableData appendBytes:length:]: range {204800, 18446744073709551615} causes integer overflow'

The file is not so big - a photo sent as a single chunk.

Disables SSLPinning on Alamofire

Wormholy overriding certificate pinning options while using with Alamofire.
I'm using the example code block to pin certificates. While Wormholy enabled, it is not working correctly.

var serverTrustPolicies: [String: ServerTrustPolicy] = [:] 
let trustPolicy = ServerTrustPolicy.pinCertificates(
    certificates: ServerTrustPolicy.certificates(),
    validateCertificateChain: true,
    validateHost: true)

serverTrustPolicies["xxxxx.com"] = trustPolicy

let configuration = URLSessionConfiguration.default

let serverTrustPolicyManager = ServerTrustPolicyManager(policies: serverTrustPolicies)

let sessionManager = SessionManager(
    configuration: configuration,
    serverTrustPolicyManager: serverTrustPolicyManager
)

return sessionManager

The content in .swift-version file, which was deprecated in CocoaPods 1.7.0, should be moved to .podspec file

while using CocoaPods version > 1.7.0, the below code in PodFile to support swift version will not work and get error when pod install.

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.2'
        end
    end
end

The CocoaPods blog says that CocoaPods 1.7.0 deprecated the .swift-version file, the swift_version should be moved to .podspec file,

Deprecating .swift-version File

Up until now, most pod authors have been relying on specifying a .swift-version file at the root of their repo in order to successfully publish their pod with the Swift version they officially support. However, this information is never transcribed within the published podspec and therefore during integration none of it is taken into consideration when choosing which Swift version to use.

This can cause numerous issues especially when a new version of Swift is released. This is because a consumer will automatically pick the latest version of Swift to use without the pod author officially claiming that it is supported.

We strongly recommend pod authors to migrate over to use the officially supported swift_version DSL within their podspec instead.

We also recommend deleting the .swift-version file in your repo unless you use it for other tools such as swiftenv. The swift_version DSL will always take precedence over the .swift-version file.

Finally, a warning will be displayed during lint that encourages pod authors to migrate away from using the .swift-version file and in a future major release of CocoaPods we plan to completely remove support for it.

http://blog.cocoapods.org/CocoaPods-1.7.0-beta/

maybe adding this line in .podspec will helps:

s.swift_version = '4.2'

Swift 5.0 crash

When I update the Xcode to 10.2, our App crashed at launch time with the log:
"Swift class extensions and categories on Swift classes are not allowed to have +load methods"
I removed Wormholy and no crash appear.

Swift 5 Compiler Error

Situation: First try installing Wormholy in my app

Result after:
/Pods/Wormholy/Sources/Subclasses/WHBaseViewController.swift:44:91: 'shared' is unavailable: Use view controller based solutions where appropriate instead.

  1. 'shared' has been explicitly marked unavailable here (UIKit.UIApplication)

Can't compile with flag "use_modular_headers!" (CocoaPods)

Hi!

Great idea!

If I use the flag "use_modular_headers!" in my pod file I get the following error:
/Pods/Wormholy/Sources/Objc/Wormholy+Foo.m:9:9: 'Wormholy/Wormholy-Swift.h' file not found

I use the latest build for cocoapods directly from the repository.
Wormholy is the only pod that gives me grief.

Using in Objective-C project

Trying to use the current version 1.5.1 in an old Objective-C project I get an error:

Wormholy does not specify a Swift version and none of the targets (xxxx, xxxx ) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

The problem is - I don't have such a setting in the project and post_install script doesn't work - I don't get to that stage at all so I can't set the version using Podfile script.

Is it possible to add the SWIFT_VERSION as the warning suggests or is there any other way to install Wormholy without modifying the project much?

Podfile not found

Hi,

While installing via Pod file getting error, that Wormholy pod file not found. Please help in this.

WormHoly Cannot get NSMutableURLRequest request.

that's my code

NSMutableURLRequest *request = [requestSerializer requestWithMethod:[obj methodString] URLString:[NSString stringWithFormat:@"%@%@", [obj apiUrl]] parameters:params error:nil];
    
    NSURLSessionDataTask *dataTask = [self.manager dataTaskWithRequest:request uploadProgress:^(NSProgress * _Nonnull uploadProgress) {
        
    } downloadProgress:^(NSProgress * _Nonnull downloadProgress) {
        
    } completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject,

breakpoint not run here in wormholy

override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
        super.init(request: request, cachedResponse: cachedResponse, client: client)
        
        if session == nil {
            session = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
        }
    }

Install for Swift 4

So, I want to install Wormholy in my project but my app is still on Swift 4, can I install newest version with Swift 4 support or do I need to install 1.1.3 version? I tried to install the newest version but I got a few errors.

Export Data

Is there a way to export the network data for a specific endpoint?

Crash on request tap

When I press on any of requests in list app crashes with exception:

Please file a radar on UIKit with this log if you see this assertion. selectorString = setKeyboardAppearance:, exercisedImplementations = {
"setKeyboardAppearance:" = (
);
}

Any suggestions what am I doing wrong? :(

Capture response headers

It'd be nice if Wormholy captured and displayed response headers as well.

I'll see if I can work up a PR at some point to add these.

iPhone X Layout issue

iphone X layout issue it's showing black screen on top I am attaching screenshots. I am using latest version of Wormholy.
03A21C10-F4F6-4D4E-9487-F015412017FA
A1A09CB1-41C5-441E-9DA4-5583DBD39794

Xcode beta 3 runtime issue

Launching an app containing Wormholy results in an immediate abort with this message:

| Swift class extensions and categories on Swift classes are not allowed to have +load methods

UIWebView 302 Redirects cause duplicate requests

When using Wormholy, a UIWebView that receives a 302 Redirect response issues 2 requests for the redirect URL. You can see it happening by monitoring the web requests in Charles. This does not happen with WKWebView but there is a bug with that implementation which means I have to use UIWebView for now.

I've attached a sample project which demonstrates the failing behaviour, and also screenshots illustrating the duplicate request.

Without Wormholy installed:
screen shot 2018-08-30 at 15 07 10

With Wormholy installed
screen shot 2018-08-30 at 15 10 33

Wormholy-WebView-Duplicate-Request-Example.zip

Layout issue

Not Working properly on iPhone 5s Layout design issue I am Unable to Read full details
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.