Back to product page

UserConnecting method


Called when a user wants to connect to the listening channel.

Type

None

Syntax

  • Basic
object.UserConnecting    Owner, Chan, Hostname, Port, Allow
The UserConnecting(object,Owner,Chan,Hostname,Port,Allow) syntax has these parts:
objectAn expression evaluating to an object of type wodTunnelNotify.
OwnerRequired. A wodTunnelCom object. Reference to the wodTunnelCom instance that called this notification method.
ChanRequired. A Channel object. Reference to the channel that was started.
HostnameRequired. A String value. Hostname that the user is coming from.
PortRequired. A Long value. Port that the user has connected from.
AllowRequired. A Boolean value. When set to False, wodSSHTunnel aborts the connection for the user.

Remarks

This method is called only if you have implemented the IwodSSHTunnelNotify interface in your application and the wodTunnel1.Notification property has received a reference to an instance of your implementation.

The UserConnecting notification method is called when someone connects to wodSSHTunnel, but before they can actually transmit any data. At this point, you can decide whether you want to allow the user to use the channel or not.

Typically, based on a user's hostname and originating port, you can see if this is an expected connection or not. As there is no way to 'hide' listening sockets from disallowed users, they will still connect, but immediately disconnect if you deny them access.

By default, the Allow argument will be set to False, unless you set channel listening on interface 127.0.0.1 - as there is no security breach that can happen on the localhost interface As this behavior helps customers who cannot handle notification methods, we had no reasons to reject their requests to make Allow = True in such cases.

Platforms

Windows