Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
module:telgate [2016/10/07 20:49] – [Telgate] campaignmodule:telgate [2024/08/19 19:04] (current) – [Command-line] document new -N option digital man
Line 1: Line 1:
-====== Telgate ====== +====== Telnet Gateway ====== 
-FIXME+The Telnet Gateway (''telgate.js'') module allows users of your system's [[server:Terminal]] Server to connect to other TCP/Telnet services on the Internet through your BBS. Typically, these services would be other telnetable BBSes, door game servers, and MUDs, although really, you can theoretically create a gate to any single-port TCP service (e.g. POP3, but not FTP).
  
-This allows users on your system to be connected to other TCP/Telnet services on the Internet through your BBSTypically, these services would be other telnetable BBSs and MUDs, although really, you can gate to any single-port TCP service (i.e. POP3, but not FTP).+The module itself (''[[dir:exec]]/telgate.js'') is just a thin wrapper around the JavaScript function: ''bbs.telnet_gate()''
  
-TELNET_GATE <"str|| str_var> [mode]+===== Usage ===== 
 +The Telnet Gateway module is normally executed via a command-line configured in [[util:SCFG]], often as an "External Program". By convention, JavaScript modules are executed from the Synchronet Terminal Server by starting the command-line with a question mark (''?'') symbol. An asterisk (''*'') prefix will also work, but will fallback to execute the old ''[[dir:exec]]/telgate.bin'' if the ''telgate.js'' file is absent.
  
-The str or str_var argument is the destination address in the format:+==== Command-line ==== 
 +The Telnet Gateway module accepts command-line arguments to control its behavior when invoked. The command-line syntax is: 
 +  ?telgate <address>[:port] [mode] [options] 
 +   
 +Where: 
 +  * ''<address>'' is the IPv4 address or host name to connect to 
 +  * ''[:port]'' is the optional TCP port number to connect to (default is ''23''
 +  * ''[mode]'' is an optional set of [[:module:telgate#mode|telgate mode flags]] (''TG_*'') OR'd together the pipe (''|'') symbol 
 +  * ''[options]'' are one or more of the following options:
  
- <addr>[:port]+^ Option ^ Value        ^ Description ^   
 +| ''-T'' | connect-timeout-seconds | Connection timeout (default: 10 seconds) | 
 +| ''-m'' | telnet-gateway-mode| Set of one or more [[:module:telgate#mode|telgate mode flags]] (''TG_*'') separated by pipe (''|'') symbols (default is ''0'') | 
 +| ''-q'' | //none//     | Don't display banner or pause prompt (be quiet) | 
 +| ''-v'' | //none//     | Display remote host name/address/port in messages | 
 +| ''-P'' | //none//     | Don't pause for user key-press before connection attempt | 
 +| ''-C'' | //none//     | Don't clear screen after successful session | 
 +| ''-N'' | //none//     | Send a blank line (CRLF) after connecting (may be used multiple times) | 
 +| ''-s'' | characters   | Send string of characters after connecting (may be used multiple times) | 
 +| ''-S'' | characters   | Send CRLF-terminated string of characters after connecting (may be used multiple times) |
  
-If port is not specified, the default is 23 (telnet), or 513 (when the TG_RLOGIN mode is used).+Option values may immediately following the option flag or may be provided as the next argument on the command-line (separated by white-space).
  
-Examples:+==== Address ====
  
- "vert.synchro.net" +The <//address//> argument is the destination address in the format''<//IP address or hostname//>[://port//]''
- "24.0.193.46" +
- "retromud.org:3000"+
  
-The valid mode bits (multiple may be |'d togetherare:+If the TCP //port// number is not specified, the default is 23 (standard for telnet).
  
- TG_ECHO         Turn on telnet echo +Examples <//address//> values:
- TG_CRLF         Expand sole CR to CRLF +
- TG_LINEMODE     Send entire lines only +
- TG_NODESYNC     Call Nodesync, get msgs, etc. +
- TG_CTRLKEYS     Interpret ^P ^U ^T, etc locally +
- TG_PASSTHRU     Pass-through telnet commands/responses +
- TG_RLOGIN       Use BSD RLogin protocol+
  
-This function can be called from any module or shell, but will most likely be used from the external programs menu (even though the telnet gate isn't technically an external program)The following modules are included (in your EXEC directory): TELGATE.BIN, MUDGATE.BIN, UNIXGATE.BIN, and RLOGIN.BINUse them as follows:+  * vert.synchro.net 
 +  * 24.0.193.46 
 +  * retromud.org:3000
  
- To set-up an external gateway to another BBS:+==== Mode ==== 
  
- Command line"*telgate vert.synchro.net"+The valid mode flags (defined in ''[[dir:exec]]/[[dir:exec#load]]/sbbsdefs.js'') are:
  
- To set-up an external gateway to a MUD:+^ Flag              ^ Description ^ 
 +| ''TG_ECHO''       | Echo back to the user's client what it sends (i.e. keyboard input) | 
 +| ''TG_CRLF''       | Expand sole CR (on input) to CRLF | 
 +| ''TG_LINEMODE''   | Send entire lines only | 
 +| ''TG_NODESYNC''   | Call Nodesync, get msgs, etc. | 
 +| ''TG_CTRLKEYS''   | Interpret control key (e.g. Ctrl-P, Ctrl-U, Ctrl-T, etc.) locally | 
 +| ''TG_PASSTHRU''   | Pass-through Telnet commands/responses (don't proxy the Telnet command responses) | 
 +| ''TG_RLOGIN''     | Use BSD RLogin protocol (not Telnet) | 
 +| ''TG_NOCHKTIME''  | Don't check time left online | 
 +| ''TG_NOTERMTYPE'' | Request client "DONT TERM_TYPE"
 +| ''TG_NOLF''       | Do not send line-feeds | 
 +| ''TG_RLOGINSWAP'' | Swap the RLogin alias/real-names | 
 +| ''TG_RAW''        | Connect to a raw TCP (not Telnet) server | 
 +| ''TG_EXPANDLF''   | Expand received sole-LFs to CR/LF pairs |
  
- Command line"*mudgate batmud.bat.org"+Multiple mode flags may be specified by ORing them together with the pipe (''|'') character, like so:
  
- To set-up an external gateway to a Trade Wars Game Server (TWGS):+  TG_ECHO|TG_CRLF
  
- Command line: "*rlogin twgs.someserver.com"+==== Others ====  
 + 
 +Although ''telgate.js'' is the original and most flexible Synchronet Telnet gateway script, there are other ''bbs.telnet_gate()'' wrapper scripts available for your convenience: 
 + 
 +^  Module          ^ Description                                                    ^ 
 +| ''mudgate.js''   | Sets the mode flags based on the needs of a typical MUD server | 
 +| ''unixgate.js''  | Sets the mode flags based on the needs of a typical Unix Telnet server | 
 +| ''rlogin.js''    | Actually a wrapper around the ''bbs.rlogin_gate'' JavaScript function | 
 + 
 +==== Examples==== 
 + 
 +To set-up an external gateway to another BBS in [[util:SCFG]]->External Programs->Online Programs: 
 + 
 +  Command line: "?telgate vert.synchro.net" 
 + 
 +To set-up an external gateway to a MUD: 
 + 
 +  Command line: "?mudgate batmud.bat.org" 
 + 
 +To set-up an external gateway to a Trade Wars Game Server (TWGS): 
 + 
 +  Command line: "?rlogin twgs.someserver.com"
  
 While using the telnet gateway (and not currently in telnet "Binary" mode), users can press ctrl-] for a menu of telnet gate commands including: Disconnect, Toggle Echo, List Users, and Private Message. While using the telnet gateway (and not currently in telnet "Binary" mode), users can press ctrl-] for a menu of telnet gate commands including: Disconnect, Toggle Echo, List Users, and Private Message.
 +
 +==== Legacy ==== 
 +
 +The Baja ''TELNET_GATE'' function and the corresponding ''[[dir:exec]]/*gate.bin'' files have been deprecated. Use the corresponding JavaScript alternatives instead.
 +
 +===== Configure =====
 +
 +The default Telnet Gateway option values and display messages can be over-ridden by creating/editing key in the ''[telgate]'' section of your ''[[dir:ctrl]]/[[config:modopts.ini]]'' file.
 +
 +^ Key                 ^ Default      ^ Description ^
 +| quiet               | false        | Don't display banner or pause prompt (quiet) |
 +| pause               | true         | Pause for user key-press before connecting |
 +| clear               | true         | Clear screen after disconnect |
 +| timeout             | 10           | Connect timeout (in seconds) |
 +| verbosity           | 0            | Display remote host address/port when non-zero |
 +| help_msg            | //see code// | Message to display for help ("" to disable) |
 +| connecting_msg      | //see code// | Message to display when connecting to remote host ("" to disable) |
 +| failed_conntect_msg | //see code// | Message to display upon connection failure ("" to disable) |
 +
 +**Note**:\\
 +You'll likely want to use string literal syntax for message strings.
 +
 ===== See Also ===== ===== See Also =====
-  * [[:module:|module index]]+  * [[:module:|Modules]] 
 +  * [[:module:RLogin]] 
 + 
 +{{tag>JavaScript}}