Recent

Author Topic: VTX Client/Server  (Read 3908 times)

codewar65

  • New Member
  • *
  • Posts: 13
VTX Client/Server
« on: July 16, 2017, 05:01:51 am »
Thought I'd share my current monkeying arounding here. ;)

This project is my attempt to render BBS style ANSI text-based console-like communications to the web browser.

The server (written in FPC) runs on the 'sysop's machine awaiting a HTTP request. The web server in the server program delivers a small HTML page, CSS, and Javascript client.

The client then connects to the server's websocket listener (on a different port than the HTTP listener) and then sends and recieves UTF-8 text with embedded ANSI escape sequences.

Upon the 'user' connecting to the server via web sockets, the server spawns an external process and the server bridges StdIn / StdOut streams of the application and the 'users' client.
(StdErr messages from the external process are logged on the server console).

Once the 'user' drops websocket connection, the external process ('node') is terminated, or if the the external process ('node') terminates, the websocket connection is dropped.

I've tested it so far in all modern Mozilla and Chromium browsers and it works great there. I, for the life of me, am unable to the client to work in Microsoft browsers. (I've never had very good luck getting javascript to run properly in IE or Edge).

Included in the project is the Free Pascal http/ws server, the javascript client, and some sample node software (also in Free Pascal).

GitHub : https://github.com/codewar65/VTX_ClientServer
Facebook: https://www.facebook.com/vtxemu/
Website: http://www.vtxemu.com/ (a bit not-up-to-date).

Feel free to poke around and comment.


codewar65

  • New Member
  • *
  • Posts: 13
Re: VTX Client/Server
« Reply #1 on: July 22, 2017, 07:16:51 pm »
I had to remove all Telnet client capabilities from the projects. I can not reliably get the Synapse api to work within a stream based telnet client. Dropped connections are undetectable. And trying to detect them throws an exception as the TTCPBlockSocket object had been freed someplace (getting the $FEEEFEEE magic number in debugger). I've even tried to encapsulate code in 'try .. except's but they explode none the less.


codewar65

  • New Member
  • *
  • Posts: 13
Re: VTX Client/Server
« Reply #2 on: July 25, 2017, 05:47:13 pm »
hmm. i had this thread locked by accident it would seem.

anyway. all is working now, including a built in telnet client into the websocket end of the server.. I had to drop back to basic fpconnect / fpsend / fprecv / fpshutdown to get it to work. i just don't know enough about coding a non-blocking socket telnet client using synapse and i couldn't get other libraries to do the trick.

i'm back to the client end (javascript) of it at the moment.

i did get it to compile on linux (fedora 26 xfce spin) with some modification but was unable to get that branch to run correctly, so i backed it out until i have time to dedicate to that cross-build.

 

TinyPortal © 2005-2018