Back to product page

PortForwardRequest event


Fires when user wants to connect to other host through the server.

Syntax

  • Basic
Private Sub object_PortForwardRequest(User, RemoteHost, RemotePort, Action)
The PortForwardRequest(object,User,RemoteHost,RemotePort,Action) syntax has these parts:
objectA wodSSHD object.
UserA SSHUser object. Reference to user who wants to open port forwarding.
RemoteHostA String value. Represents remote hostname where wodSSHServer should connect.
RemotePortA Long value. Port on remote server where wodSSHServer should connect.
ActionA SSHActions enumeration, as described in settings. Action to perform - Allow allows connection, Deny refuses it.

Remarks

The settings for Action are:

Constant Value Description
Deny0 Deny execution of the action.
Allow 1 Allow to execute action.


This event is fired when connected user requests service from wodSSHD to connect to specific hostname/port on some other server. If you want to allow this action, set Action to Allow. wodSSHD will initiate connection with the server at that point. If connection is successfull, client will be notified, and wodSSHD will start forwarding data from the client to the end-point of forwarded connection, and vice versa.

Forward requests are typically used to protect plain communication from 3rd party sniffing (eavesdropping). For example, instead of connecting from his computer, client can request server to initiate connection for him. Complete traffic between wodSSHD server and the client will be encrypted (it's traveling through already established SSH connection).

You can change RemoteHost and RemotePort values from this event. If you do so, client will not be aware of this change, and it will still think it got connected to the host/port for which his request was initiated.

If wodSSHD should bind some port on the server and accept connections, event PortBindRequest will be fired.

Since version 1.1.1.1, it is possible that RemoteHost="" and RemotePort=0. This happens when you change service type in ServiceRequest event to stPortForwarding. This event is fired in such cases so you can specify on which host and port user's service will be redirected.

Platforms

Windows