• 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
sample code for SOCKS proxy support?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sample code for SOCKS proxy support?


  • Subject: sample code for SOCKS proxy support?
  • From: John Chu <email@hidden>
  • Date: Wed, 7 Jan 2004 10:01:25 -0500

Hi,

Is there sample code somewhere for how to use SOCKS proxy support on a CFStream?

I've been following the instructions in CFSocketStream.h which is something along the lines of:
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,rc.server.machine ,
rc.server.port,&rs,&ws);
CFReadStreamSetProperty(rs,kCFStreamPropertySOCKSProxy,rc.proxy);
(where rc.proxy is the dictionary I got from the SystemConfiguration framework)

I go on to set callbacks for the readstream and the writestream and then open the two streams.

The result is EXC_BAD_ACCESS. Here is the stack dump:

#0 0x901b4678 in __SOCKS5GetHostByNameCallBack ()
#1 0x90086654 in gethostbyname_async_handleReply ()
#2 0x9015bd8c in __CFMachPortPerform ()
#3 0x9015bbf8 in __CFRunLoopDoSource1 ()
#4 0x90148c9c in __CFRunLoopRun ()
#5 0x90180f58 in CFRunLoopRunSpecific ()
#6 0x901b4100 in __PerformSOCKSHandshake_Unsafe ()
#7 0x901c232c in socketCallBack ()
#8 0x90162c7c in __CFSocketPerform ()
#9 0x90149414 in __CFRunLoopDoSources0 ()
#10 0x901487f8 in __CFRunLoopRun ()
#11 0x90180f58 in CFRunLoopRunSpecific ()
#12 0x90148240 in CFRunLoopRun ()
#13 0x000038a4 in main (argc=5, argv=0xbffffd94) at socks_relay.c:322

Does anyone have any suggestions on why I'm getting EXC_BAD_ACCESS?
(I've checked the dictionary and the correct entries for the host and port are in there.)

Thanks.
john
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Reading HTTP headers (was Re: cfsockets vs OT)
  • Next by Date: CFStream: setting the time out
  • Previous by thread: Re: Reading HTTP headers (was Re: cfsockets vs OT)
  • Next by thread: CFStream: setting the time out
  • Index(es):
    • Date
    • Thread