maldorne / mud-web-proxy

Web proxy for playing MUD / MUSH / MOO games.
https://www.maldorne.org
Other
9 stars 3 forks source link

Proxy not connecting to telnet #7

Open pittbull opened 1 year ago

pittbull commented 1 year ago

I stumbled upon your proxy and client and wanted to test it out for a mini mud project I'm running.

Got it all set up and the files configured, but I am unable to get the proxy to connect to the mud. Here's the config files:

wsproxy.js

let srv = {
  path: __dirname,
  /* this websocket proxy port */
  ws_port: 6200,
  /* default telnet host */
  tn_host: 'dikumud.<myhost>',
  /* default telnet/target port */
  tn_port: 4242,
  /* enable additional debugging */
  debug: true,
  /* use node zlib (different from mccp) - you want this turned off unless your server can't do MCCP and your client can inflate data */
  compress: true,
  /* set to false while server is shutting down */
  open: true,
  ttype: {
    enabled: 1,
    portal: ['maldorne.org', 'XTERM-256color', 'MTTS 141'],
  },
  gmcp: {
    enabled: 1,
    portal: ['client maldorne.org', 'client_version 1.0'],
  },

src/config.js

debug: param('debug') || 1,
host: param('host') || 'dikumud.<myhost>',
port: param('port') || '4242',
name: param('name') || 'House of PittBull',
...
proxy: 'wss://dikumud.<myhost>:6200/',

socket.js var proxy = 'wss://dikumud.<myhost>:6200/';

I see the connection being established in the proxy console:

(node:462809) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
2023-08-04T10:32:44.442Z : (ws) server listening: port 6200
2023-08-04T10:32:48.484Z : (ws on connection) new connection
2023-08-04T10:32:48.484Z : (ws on connection) connection count: 1

But my website is just blank:

image

I am able to telnet to the mud from the container running the web-proxy-client.

Any insights?

neverbot commented 1 year ago

I've checked my configuration and haven´t been able to find anything different, your config seems to be ok 🤔

In my case, I'm executing both the mud server and the proxy in the same machine, without using containers, I'm assuming your are using one container for the mud server and another for the proxy, could the problem be related to this? Maybe the proxy is not able to connect to a different container through the docker network?, even if you could telnet from one to the other. (I updated this code from an already existing project, don't know the inner workings in deep to be sure).

emersonrp commented 7 months ago

I'm having the same trouble - the client connects to the proxy, the proxy announces there's a new connection, but then black screen on the client and no further output for the proxy. No containers or anything are involved, the proxy and the MOO are processes running "bare-metal" on the same (vm) host.

Pertinent config:

wsproxy.js

   /* default telnet host */                                                                                          
   tn_host: 'hayseed.net',                                                                                            
   /* default telnet/target port */                                                                                   
   tn_port: 7777,

config.js

  host: param('host') || 'hayseed.net',                                                                                  
  port: param('port') || '7777',                                                                                         
  <snip>
  proxy: 'wss://hayseed.net:6200/',

socket.js

var proxy = 'wss://hayseed.net:6200/';

The rest is unchanged from default. Doing a telnet hayseed.net 7777 from the host connects to the MOO just fine, so the hostname is resolving to itself correctly.

Any thoughts? Not sure how to go about debugging this further. Thanks in advance.