[jdev] Transfer File problem

Rachel Blackman rcb at ceruleanstudios.com
Fri Dec 10 14:01:20 CST 2004

> - I create the socket.
> - I do 'CONNECT' with Streamhost (other machine directly) using this 
> socket,
> on IP address and port which streamhost sends to me.
> - This connection completes successfully.

This is because you're doing a normal TCP connection.

> - I do 'CONNECT' with SHA1(streamid+initiatorjid+targetjid) hostname 
> and
> port 0, with the same socket I use for connecting with Streamhost 
> before, it
> returns it can't connect.

You don't do the same thing here.  With the socket you now have open, 
you need to use SOCKS5 (RFC1928, which can be found at 
http://www.ietf.org/rfc/rfc1928.txt for reference) to request a 
connection from the streamhost to that SHA1'd string, as if you were 
connecting to a SOCKS5 proxy for general Internet use.

A streamhost is basically pretending to be a SOCKS5 proxy server, so 
once you've connected you need to do the SOCKS5 negotiation and then 
issue the SOCKS5 'CONNECT' command -- the command in the SOCKS5 
protocol which requests a connection to a destination site -- to the 
streamhost.  /Not/ a normal TCP connect() call, a SOCKS5 command packet 
with the SHA1'd host as the destination field.

Does that help?

Rachel 'Sparks' Blackman -- sysadmin, developer, mad scientist
"If it is not broken, give me five minutes to redesign it!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20041210/0ad2b831/attachment-0002.pgp>

More information about the JDev mailing list