Code center > Darwinbots3

P2P Internet Mode

(1/12) > >>

goffrie:
It would be nice if there was a peer-to-peer network of sorts for Internet Mode in Darwinbots3, in which all capable clients would be able to connect to each other directly. Of course, there would still be a central server, but it would reduce the load on the central server, and a relay system could be set up to allow clients behind firewalls to connect to IM (maybe falling back to FTP). It would also be possible this way to have relatively real-time organism exchanges, as the server could tell the clients when a new organism was available and clients could download it as soon as they were told (the server could randomly choose a client to give it to). If the Darwinbots server can't run custom protocols, it could probably be managed over HTTP. The protocol itself should be fairly trivial, as it does not need to support a lot of features (maybe just compression), and efficiency is not a major issue. The only issue I see with this is that many people run behind routers and the system does not really work that way .

Of course, as Darwinbots3 is still early in development, it's not really time just yet to be implementing these kinds of things, but it's just an idea .

Numsgil:
I've played with the idea of having Darwinbots connect to the web server and run some sort of PHP script to upload and download bots.  If you could connect to the home page or forum, you could run IM.  But I'm about as green as it comes with PHP scripts.  I don't even know if what I want to do is possible (though I imagine it is...)

goffrie:
Hmm, I'm pretty good with PHP  
It definitely is possible, using HTTP POST with multipart/form-data. It could even work with ordinary POST (that wouldn't work with a web browser though). If you wanted, I could cook up a PHP script which would handle organism uploads. I have no idea how you would interface it with Darwinbots though, and you'd have to tell me where to store the files  .

Another thought, for P2P, perhaps it could interface with Tor and hidden services? That would solve any problems with NATs (firewalls would still be a problem though). It would be pretty finicky(sp?) and slow though.

Numsgil:
Yeah, I was looking at POST commands.  But I didn't understand it well enough and dropped the idea.  I would certainly appreciate any help writing the PHP script.  I can probably play with it if I had one that worked.  We could probably even set up the existing DB2 to use it...

What needs to happen is that I can call something like this:

www.darwinbots.com/IMMode/UploadScript.php?file="C:\Program Files\Darwinbots3\IM\out\Mybot256734532342344.dbo"

Or whatever the syntax would be.  It can't have a "choose the file" dialog pop up, since it needs to be entirely automated and behind the scenes.  UploadScript.php would then upload that file to some directory on the server that I could set.  It should also have a file size limit that I could set.

A similar script called DownloadScript.php?directory="C:\Program Files\Darwinbots3\IM\in\" would somehow download a binary file from the IM directory on the server and store it in the local directory specified, and then delete the file from the server.  It also can't have one of those "where do I download this too" dialogs pop up, since it also needs to be entirely behind the scenes and automatic.

I think I know how to call a URL from Darwinbots, so if you could cook up some PHPs like that, that I could put on the server and call, that would be very cool indeed.

goffrie:
You can't really tell the web client to upload a file like that. (It would be nice though ) You need to read the file and upload it as POST data, like "data=buibtuisnuiremhtr5398nf9324==" (base64 encoded or otherwise made 7-bit friendly). Then you could download the file from the server. I don't know if it's possible in VB, but it's almost certainly doable with C#.

Navigation

[0] Message Index

[#] Next page

Go to full version