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, October 31, 2024 16:57:16
from
System
via
Telnet
Guest
Tuesday, October 29, 2024 20:09:49
from
System
via
Telnet
Guest
Monday, October 28, 2024 20:03:56
from
Balls
via
Telnet
Guest
Monday, October 28, 2024 10:13:28
from
Gaga
via
Telnet
System Info
Sysop:
Ree
Location:
Toronto, ON
Users:
2
Nodes:
10 (
0
/
10
)
Uptime:
195:57:42
Calls:
353
Files:
2
Messages:
37,825