Last active
December 23, 2015 13:09
-
-
Save masbog/6640119 to your computer and use it in GitHub Desktop.
AuthBasic For HTTP streaming .m3u8 with passworded iPCam iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSURLCredential *credential = [[[NSURLCredential alloc] | |
| initWithUser:@"masbog" | |
| password:@"gobmas" | |
| persistence: NSURLCredentialPersistenceForSession] autorelease]; | |
| NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] | |
| initWithHost: @"180.61.3.1" | |
| port:31608 | |
| protocol: @"http" | |
| realm: nil | |
| authenticationMethod: NSURLAuthenticationMethodHTTPBasic] autorelease]; | |
| [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential forProtectionSpace: protectionSpace]; | |
| if you using ARC, remove autorelease :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment