• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURL from behind firewall
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURL from behind firewall


  • Subject: NSURL from behind firewall
  • From: Gokul Hegde <email@hidden>
  • Date: Fri, 26 Apr 2002 16:33:09 +0530

Hi everybody

In one of my applications, I need to enable the proxy server support i.e. my
application should be able to access the URLs even sitting behind a
firewall.

I was trying out using NSURL.

I find that I cannot use something

NSURL *the_pUrl = [[NSURL alloc] initWithString: @"http://www.apple.com";];
NSData *the_pData = [the_pUrl resourceDataUsingCache: NO];

as the local network will not find the host 'www.apple.com' and hence fail.

Now to access the URL through firewall, I will have to use the firewall
server as the host and the URL as the path. (I have done this with
applications in Java and C++ and they work fine).

But I am not able to use the 'initWithScheme:host:path:' method of NSURL.
(Which I feel is the one to be used for this situation.)

I have written

NSURL *the_pUrl = [[NSURL alloc] initWithScheme: @"http" host:
@"123.123.123.4" path: @"http://www.apple.com";];
NSData *the_pData = [the_pUrl resourceDataUsingCache: NO];

// Where 123.123.123.4 is the IP address of my firewall server.

But I get a run time error "path http://www.apple.com is not absolute path"!

I have tried different varients / combinations of these, but always get an
error or nil into the_pUrl.

What am I doing wrong? How do I access a URL in Cocoa application sitting
behind a firewall ?

TIA.

With regards

Gokul


--------------------------------------------------------------
Robosoft Technologies, Mangalore, India
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSURL from behind firewall
      • From: Steve Bird <email@hidden>
  • Prev by Date: Re: Wait / Busy Cursor
  • Next by Date: Re: Wait / Busy Cursor
  • Previous by thread: CFUUID vs. -[NSProcessInfo globallyUniqueString] (was Re: NSInvalidArgumentException : can't send message to abstract object)
  • Next by thread: Re: NSURL from behind firewall
  • Index(es):
    • Date
    • Thread