Shortlink

Authenticated Proxy Connection on iOS

So I just finished committing the first build of APProxyViewController at https://github.com/woodnathan/APProxyViewController

Currently, the username and password inside the Settings app for a HTTP proxy is stored inside a keychain that Apple’s apps can access. That means that the other applications don’t have access to it and must ask the user for the credentials. This class simplifies the process by providing the UI and the handling so that the connection request can continue.

I will be updating it soon with a delegate so that it’s dismissal can be handled correctly. Otherwise check out the README in the repository for how to use the class.

Shortlink

12 iOS Development Libraries

Josh Grenon has compiled a great list over at http://joshgrenon.com/2011/03/21/12-open-source-libraries-to-speed-up-your-ios-development/

It lists 12 libraries to speed up development, however I prefer TouchJSON over the JSON Framework listed in the post as there are slight differences between each.

Shortlink

PHP: curl_getinfo

In my previous post, http://www.woodnathan.com/2010/10/using-curl-to-authenticate-users-in-php/, I posted code that allowed you to check the HTTP response code to authenticate users from a form. In it I used the explode function to separate lines of the HTTP headers, however a better way to obtain the required “200 OK” would be to use the PHP function curl_getinfo it provides a much cleaner way of obtaining the HTTP response code.

Shortlink

Using cURL to authenticate users in PHP


You might have a login system in which you are required to authenticate your users against a realm on a separate web server.
With some minor adjustments you could make it work with some other authentication methods, but currently it just works with Basic authentication.

Well this is the code that I used to only get the HTTP status code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $settings[0]["value2"]);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, ($username.":".$password));
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HEADER_OUT, true); //Should be CURLINFO, however it's not required
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$data = explode("\n", $data);
$data = explode(" ", $data[0]);
$status = $data[1];

Shortlink

VLC for iPad

I always looked forward to the day when I could play AVI movies straight on my iOS device. However, here I sit now, writing this post whilst iSkysoft iPhone Video Converter runs in the background telling me that it will be completed 2-3 hours.

This arises from the fact that I just went to use VLC for iPad but found that it doesn’t work as well as I would like. It looks pleasant, the icon, the shelf type layout for the list of videos. The first issue I had with it was that I had to use iTunes to transfer the files to the application, but I could deal with that and it is the easiest for both the user and developer.

The biggest issue I had with VLC for iPad was that the audio and video dropped out of sync. It probably was just the fact that it was an AVI file, but in that case, I may as well use the built in Videos application.

I expected it all to work, but now I no longer have VLC for iPad installed.