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, November 28, 2024 00:53:07
from
Ca
via
Telnet
Guest
Thursday, November 28, 2024 00:51:58
from
Ca
via
Telnet
Guest
Wednesday, November 27, 2024 10:19:12
from
Gd
via
Telnet
Guest
Wednesday, November 27, 2024 10:18:22
from
Fs
via
Telnet
System Info
Sysop:
Ree
Location:
Toronto, ON
Users:
2
Nodes:
10 (
0
/
10
)
Uptime:
142:45:10
Calls:
369
Files:
2
Messages:
38,444