Pop-Up Thingie
Sidebar
fTelnet Demo Server
Home
Forum
Files
Dark
Register
Log in
Username
Password
Sidebar
Forum
DOVE-Net
Synchronet JavaScript
Final Proxy Code
From
Drakmir
@VERT/HDONE to
Digital Man
on Friday, October 07, 2005 01:34:00
0
0
load("sbbsdefs.js"); // CON_RAW_IN
load("sockdefs.js"); // SO_RCVBUF
function sendData(socketA, socketB)
{
var bRetVal = false;
var buf;
if(socketA.data_waiting)
{
var numRead = socketA.nread;
if (numRead >= 512) numRead = 512;
buf = socketA.peek(numRead);
if (numRead != buf.length)
{
while(numRead > 4)
{
buf = socketA.recvBin(4);
socketB.sendBin(buf, 4);
numRead -= 4;
}
if (numRead > 0)
{
buf = socketA.recvBin(numRead);
socketB.sendBin(buf, numRead);
}
}
else
{
buf = socketA.read(numRead);
socketB.write(buf);
}
bRetVal = true;
}
return bRetVal;
}
try
{
if (argc < 2)
{
throw("No parameters passed.");
};
var socket = new Socket();
if(!socket.bind()) {
throw("!bind error " + socket.last_error + "\r\n");
exit();
}
var addr=argv[0];
var port=argv[1];
if(!socket.connect(addr,port)) {
throw("!connect error " + socket.last_error + "\r\n");
exit();
}
log("\r\nConnected to " + addr + ":" + port + "\r\n");
while(socket.is_connected && client.socket.is_connected)
{
if (sendData(socket, client.socket)) continue;
if (sendData(client.socket, socket)) continue;
sleep(1);
}
log("\r\nEnd of socktest!\r\n");
}
catch(E)
{
log("Caught error - " + E);
exit(-1);
}
exit(0);
---
þ Synchronet þ Holodeck One - bbs.holodeckone.com
Who's Online
Recent Visitors
Guest
Thursday, December 26, 2024 15:33:44
from
/bin/busybox Cat /proc/self/ex
via
Raw
Guest
Thursday, December 26, 2024 05:46:57
from
/bin/busybox Cat /proc/self/ex
via
Raw
Guest
Wednesday, December 25, 2024 17:22:00
from
/bin/busybox Cat /proc/self/ex
via
Raw
Guest
Tuesday, December 24, 2024 05:02:35
from
/bin/busybox Cat /proc/self/ex
via
Raw
System Info
Sysop:
Ree
Location:
Toronto, ON
Users:
2
Nodes:
10 (
0
/
10
)
Uptime:
116:01:45
Calls:
375
Calls today:
2
Files:
2
Messages:
38,888