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 [2024/05/27 23:34] – TG_PASSTHRU is no longer the default digital manmodule:telgate [2024/08/19 19:04] (current) – [Command-line] document new -N option digital man
Line 5: Line 5:
  
 ===== Usage ===== ===== Usage =====
-To use the module:+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.
  
-Execute ''telgate.js <address> [mode]''+==== 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:
  
-The brackets are not part of the syntax but only used to clarify which arguments are required (''<>''and which are optional (''[]'').+^ 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) |
  
-When executed from a command-line with the [[server:Terminal]] Server (e.g. as a //door//), the ''?'' or ''*'' prefix is required. +Option values may immediately following the option flag or may be provided as the next argument on the command-line (separated by white-space).
- +
-If no //mode// value is specified, the default mode is ''TG_NONE''.+
  
 ==== Address ==== ==== Address ====
Line 43: Line 58:
 | ''TG_NOLF''       | Do not send line-feeds | | ''TG_NOLF''       | Do not send line-feeds |
 | ''TG_RLOGINSWAP'' | Swap the RLogin alias/real-names | | ''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 |
  
 Multiple mode flags may be specified by ORing them together with the pipe (''|'') character, like so: Multiple mode flags may be specified by ORing them together with the pipe (''|'') character, like so:
Line 76: Line 93:
  
 The Baja ''TELNET_GATE'' function and the corresponding ''[[dir:exec]]/*gate.bin'' files have been deprecated. Use the corresponding JavaScript alternatives instead. 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 =====