in Musing

How to use SOCKS proxy in an iOS device

As you may know, I’m one of the Apple’s fans and love to use my iOS gadgets (iPhone and iPad) in every type of tasks. Many of iOS users are using their iPhones/iPads in enterprise environments and want to connect to their company’s network while at work. In some cases, network administrators set a proxy server so users must connect to that proxy in order to access internal websites and more. As you know, iOS is currently supports HTTP proxy but it’s not enough for many users because their company’s network administrators set SOCKS proxy instead of HTTP!

By the time, there are some applications that can be installed in order to use SOCKS proxy in an iOS device but these apps are only available for jailbroken devices so other users can’t install them!

In this post I want to tell you how to use SOCKS proxy in an unjailbroken iOS device.

Note: In this example I’m using an iPhone to demonstrate the steps but you can use any iOS device; there’s no limitation at all!

The first thing you need is a web server (or any computer which has access to the internet). In this example my webserver is a PC with Windows 7 ultimate installed but you can use any type of web server you want. We use this web server in order to upload a .pac file!

The .pac file

A proxy auto-config (PAC) file defines how web browsers and other user agents can automatically choose the appropriate proxy server (access method) for fetching a given URL.

A PAC file contains a JavaScript function "FindProxyForURL(url, host)". This function returns a string with one or more access method specifications. These specifications cause the user agent to use a particular proxy server or to connect directly.

For more information about PAC files Click Here

Now you need to create a PAC file like the following:

function FindProxyForURL(url, host)
{
  return "SOCKS 192.168.0.1:3128";
}

After you’ve created the PAC file, upload it to your webserver.

Finally, you have to configure your iOS device. In the Setting app, tap on the Wi-Fi and then tap on the arrow in the right side of your selected access point:

WI-FI Networks

Then set HTTP proxy to “Auto” and then enter the URL of the PAC file you’ve uploaded to the webserver in the URL text box.

WI-FI Network Setttings

You’re done! Now you can access to your SOCKS proxy server!

If you have any question about this post, please leave your comments down below and I’ll answer them as soon as possible.

Hope it helps.

  • Roy

    I've done what you've done, but for some reason it's not working? The .pac is uploaded and I've tested to see if I can view it on Safari, it's entered correctly in the URL section under HTTP Proxy, the IP Address is DHCP if that's of any use.. I'm not sure what I'm doing wrong. :/

  • Roy

    One more thing, I'm using;

    function FindProxyForURL(url, host) {
    return "SOCKS localhost:42280";
    }

    and I've tried 127.0.0.1:42280 too but no luck.. 🙁

  • Admin

    @Roy:
    This sample may not work for some reasons.
    The problem can be of your web server! Many of web servers such as IIS, deny .pac files by default. So you have to add .pac files to trusted extensions.
    For more information about setting .pac files in IIS, you can use the following link:
    http://marckean.wordpress.com/2010/02/09/setting-up-proxy-pac-files-in-iis7-for-proxy-use/

  • Roy

    I got it working, but the proxy only seems to work with Safari and the App Store, when I try to open some apps they close instantly and/or don't work correctly after logging in. 🙁

  • Admin

    @Roy:

    Me and most of my colleagues are using this and we don't have any problem at all.

    I believe you're doing it wrong or there's a problem.

  • Ali

    How we can add user and pass ?
    And can use the Internet share file server?

  • Admin

    @Ali:
    It's not common to use username and password along with .pac files but here you go:

    The pattern for creating the PAC file with username and password is this:
    return "SOCKS [username]:[password]@[proxy]:[port]"
    All you need to do is to replace [username], [password], [proxy] and [port] parameters with yours.

  • Admin

    @Ali:
    There's no limitations at all. You can use this in any server. But the server must be connected to the internet.

  • Admin

    @Ali:
    There are lots of apps you can use such as iProxy. But I think this is the best way to access the proxy server.

  • Ali

    I rather to use this way
    But I got a socks account from a seller company that sell socks and https proxy for use in proxifier on win
    And I used as the same you told

    But it don't work!
    I really need it,
    If I would have had a guide with more detail I could use it
    I really need it,

  • Admin

    Life is more complicated than you think 😉 Maybe I should optimize my blog more than before. I'll be working on this issue to solve it as soon as possible.

  • Admin

    @Ali:
    i just realized that @ is not working in the proxy server settings when want to associate authenticated information to it.

    I'm currently working on it to find a way. I'll post consequences as a comment here as soon as I found anything.

  • Credit Card

    You are right on the mark. I love your blogs; very funny; like the philosophy.

  • Ali

    I find a way for user and pass but i want set HTTPS proxy or in .PAC file
    Do you how i can set it?

    because with normal proxy in .PAC file you can't pass through sanction(embargo)

    Simply I need it, please help me

    MY HAND TO YOUR SKIRT ,PLEASE HAVE MY WEATHER! YOUR HAND IS RIGHT ! 🙂

  • Vh

    Hello,i'm iranian .it seems that you're iranian too because of MTN irancell!
    so i didn' t under stand the text exactly. So can you help me with the farsi version of your text
    By sending it to my email or post it to your site. I will thank you if you help me
    Thanks

  • mohammad

    salam,khaste nabashin.bebakhshin man engelisim dar on had khob nist ke betonam matne balaro tarjome konam.hamontor ke dostemon goftan shoma be nazar ke na sad dar sad irani hastin,age zahmati baraton nadare ye lotfi bokonin tarighe sakhte pac baraye man besorate farsi mail konin ye donya mamnon misham azaton.mr30 babate post aaaliton.

  • Admin

    Vh and mohammad:
    Unfortunately, I don't have enough time to post another blog. Also, My blog is based on English and I don't have Persian blog either. You can search the web for it.
    By the way, The goal of this post is to learn how to use proxy in industry not in order to bypass internet restrictions.

    I'm sorry about this.

  • mason

    do you find anything about authentication?

  • Saeed

    hi mr ramezanpour. im not good at english. i search all the net for using socks proxy for ipad & iphone. but i didnt finde anything for this. can you help me for this? you know about filtering and vpn is not very good. please help me for this. i want to use socks proxy on my ipaaaad. please

  • Admin

    @Saeed:
    As far as I know, the only way to access a SOCKS proxy server via an iOS device, is the way I've described above.
    By the time, I don't know any alternatives.

  • Sadegh

    Hi.
    tanks for describe 🙂

    what kind of application must be install on server for running socks proxy?

  • Admin

    @Sadegh:
    I don't have any idea about this. It can be any kind of proxy servers! It depends on what you want to do with that proxy.

    Besides, This blog post is not about bypassing internet restrictions.

  • Admin

    Not yet.

  • Kia

    Hi dear supporter : I have questiOn about that how can I upload the PAC file on to the webserver ? Tanx alot

  • Tej

    I got SOCKS working on my unjailbroken iPad with Putty + mongoose. Thanks!

  • Hossein

    Hi,
    The version of SOCKS is important or not ?
    i mean is there any difference between socks4 or socks5 ?
    Thanks

  • Hossein

    I found out that the problem is authentication.
    in CCProxy, when i turned off the authentication the SOCKS works fine, but when i active username&pass and enter the string like [SOCKS USER:PASS@IP:PORT], it doesn't work at all.
    Can you help me with this problem ?

    Thnaks in advance.

  • Admin

    @Tej: Thanks for informing us man 🙂

  • Admin

    @Hossein:
    Unfortunately, I haven't found anything for using authentication because I don't need it 😉
    But I see most people want to use authentication. I'll do my best to blog about it as soon as possible.
    Anyway, thanks for your information.

  • mohammad

    محمد مهدی جان لطفا یه آموزش فارسی هم بذار ما هم بفهمیم باید چیکار کنیم

    خیلی گلی

  • Madjid

    Hi Mohammad. What about for “Https” proxy type?

  • @Madjid:
    You need to replace "SOCKS" with "PROXY"

  • farhad

    سلام اگه امکان داره ساکس و پروکسی روی آیفون رو به فارسی آموزش بده

  • AJ

    Is it possible to do this per app on iOS? Meaning only have the traffic of a specific app use the SOCKS proxy?

  • @AJ:
    No.

  • Salam,
    Doostan be nokate zir tavajoh dashte bashand:

    1) agar baraye rah andaziye .pac files baraye iOS mikhayd , hatman deghat konid ke semicolon dar akhare return "SOCKS localhost:42280"; bayad HAZF beshe, agar baraye windows mikhayd nabayad HAZF beshe.

    2) hatman deghat konid dar IIS ya har webserver e dige MIME type .pac ro tarif karde bashid tebghe linki ke yeki az doostan dade: http://marckean.wordpress.com/2010/02/09/setting-up-proxy-pac-files-in-iis7-for-proxy-use/

    3) tarjihan baraye test agar az ccproxy estefade konid , CHECK BOX e disable external users , ro OFF konid va be hameye dar authentication be hame PERMIT ALL bedid.

    moafagh bashid

  • Yes it's true. But you can change the file's extension to whatever you want. e.g.: txt and it works.

  • The interest rate of unsecured loans is bit taller in comparison connected with secured loans. computers, house appliances) moreover registered movable residence (i.e.

    Also visit my site :: short term loans uk – http://www.tuzonadeventa.comhttp://www.tuzonadeventa.com/index.php/member/5869

  • I would recommend that anyone with small children only purchase carpet that is stain protected. The only cleaning component used is heat that is produced by the steam. Carpet Cleaning Romford also recommends using a lint roller to deal with small thick patches of pet hair.

    Look into my homepage – Carpet Cleaners Newark New Jersey – http://www.youtube.com/watch?v=MCFi0Xwf2co

  • In that case you would just use you database of cash buyers. How did they handle your call or your first appointment with them. If you think about how important that hot bath or shower is to your daily routine, you understand how important it is that you get all of the hot water you need.

    Here is my page; 1 – Daisy – http://wiki.tau.ac.il/maphilos/index.php/%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:FranklinRalston ,

  • Help the environment by installing solar panels at home, that way you'll pay less for electricity and you won't harm the planet. Use an ice cube to harden candle wax or gum in carpet, scrape off, and then clean as you would any other spot. Steam cleaning is used for cleaning the deeper layers of the carpet that the nozzle of the vacuum cleaner cannot reach.

    Feel free to visit my web blog; Oriental Rug Cleaning Vineland NJ – http://www.youtube.com/watch?v=igPAbF_InMc

  • They also want to hang around for the entire holiday season. A hose is run from the tank to feed a hot water heater inside the van. Carpet cleaners Southampton is the most wide-ranging cleaning system in the UK.

    My page :: carpet cleaning toms river nj – http://Youtube.com/watch?v=NT1vW8qu-kM

  • The vacuum cleaner manufacturing industry may have been concerned that adopting a more reliable test protocol would "upset the apple cart" or transfer the balance of power from the larger manufacturers to the smaller, more pragmatic manufacturers. The main goal is to treat the window treatments, carpets and rugs like various companies would treat the own. If you want make sure that the carpet is completely germ-free, apply a deodorizing or sanitizing solution.

    Also visit my site; Carpet Cleaners Piscataway New Jersey – http://www.youtube.com/watch?v=wBKNQLupeAE

  • They could teach an individual or perhaps a whole team to work the brand new business telephone techniques and ensure their customers are wholly self-confident in using their new enterprise telephone method.

    Also visit my website – businesstelephonesystems – http://thebridescoop.com/news/business-telephone-systems-2/

  • In this article, read about how to repel ants naturally through home remedies. What in the world, does one have to do with the other. Carpet cleaners Southampton is the most wide-ranging cleaning system in the UK.

    Take a look at my web site: Carpet Perth Amboy Nj – http://www.youtube.com/watch?v=jVmaqVwRSCA

  • The vacuum cleaner manufacturing industry may have been concerned that adopting a more reliable test protocol would "upset the apple cart" or transfer the balance of power from the larger manufacturers to the smaller, more pragmatic manufacturers. Your carpet cleaning service provider should be experienced enough to get the job done in an effective manner. If you enjoy your plush flooring then you absolutely must protect it against accidental spills and carelessness.

    Also visit my web page :: carpet cleaning mount laurel new jersey – http://www.youtube.com/watch?v=Dj369y_7Ve4

  • They will just remove the worst of the dirt and will not make individual stain removal. The only cleaning component used is heat that is produced by the steam. If that is the case, it would be a good idea if you go to establishments which offer carpet cleaning in Atlanta.

    Also visit my webpage: Upholstery Cleaning Washington NJ – http://www.youtube.com/watch?v=gpUPOSX2qag

  • They will just remove the worst of the dirt and will not make individual stain removal. Use an ice cube to harden candle wax or gum in carpet, scrape off, and then clean as you would any other spot. Carpet cleaners Southampton is the most wide-ranging cleaning system in the UK.

    Look into my web site Carpet Cleaners Brick New Jersey – Raina – http://www.youtube.com/watch?v=kRBFUctHEVk

  • To begin with, business carpet cleaning devices have bigger temperature and pressure amounts for more thorough cleansing. The main goal is to treat the window treatments, carpets and rugs like various companies would treat the own. If you want make sure that the carpet is completely germ-free, apply a deodorizing or sanitizing solution.

    Feel free to surf to my web-site :: Carpet Cleaning Parsippany New Jersey – http://www.youtube.com/watch?v=fp0Ya6wlpSI

  • In this article, read about how to repel ants naturally through home remedies. The only cleaning component used is heat that is produced by the steam. If you enjoy your plush flooring then you absolutely must protect it against accidental spills and carelessness.

    my blog – Carpet Cleaning Cherry Hill NJ – http://www.youtube.com/watch?v=a-ovi1HlkbY

  • What a data of un-ambiguity and preserveness of valuable experience on the topic of unexpected feelings.

    My web site; forstoring-penis.eu ( iretailmarketing.com – http://iretailmarketing.com/node/21683 )

  • For this reason, most home owners choose to rent a carpet cleaner and do it themselves instead. It is then washed off after it has settled for a few minutes. Moreover, the modern techniques of cleaning carpets, applied by this company and their smooth methodologies make the process look smoother and cleaner.

    Take a look at my blog post Carpet cleaning NJ – http://lapiedraverde.org/index.php/Understanding_Significant_Factors_Of_carpet_cleaning_service

  • Remarkable issues here. I am very glad to look your post. Thank you a lot and I'm looking ahead to touch you. Will you kindly drop me a e-mail?

    Feel free to surf to my blog post – ทัวร์ญีปุ่น – https://www.facebook.com/hilightjapantour

  • Huge version never held much heat in them while the slim version heats up fast. Sony was attacked in a number of areas, including their website, network and gaming platform. Plus, since it comes right above L1 and R1 buttons, switching between the four forward-facing buttons invariably does up with your fingers scraping the bottom of the keypad.

    Here is my web blog ps2 emulator benchmark – worldwidewesternfront.com – http://worldwidewesternfront.com/user.php?login=josefinat