We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67cb501 commit 3cfb400Copy full SHA for 3cfb400
1 file changed
lib/SAM3.php
@@ -174,4 +174,24 @@ public function acceptSession( string $sessionId ):SAM3 {
174
return $sam3;
175
}
176
177
+ public function forwardSession( string $sessionId, int $port, string $host = null ):SAM3 {
178
+ $sam3 = new SAM3( $this->samHost, $this->samPort, $this->signatureType );
179
+ $sam3->connect();
180
+
181
+ $commandString = "STREAM FORWARD ID=" . $sessionId . " PORT=" . $port;
182
183
+ if ( !is_null( $host ) ) {
184
+ $commandString .= " HOST=" . $host;
185
+ }
186
187
+ $commandString .= " SILENT=false";
188
189
+ $reply = $sam3->commandSAM( $commandString );
190
+ if ( $reply->getResult() === \PHP_SAM\SAMReply::REPLY_TYPE_OK ) {
191
+ $sam3->sessionId = $sessionId;
192
193
194
+ return $sam3;
195
196
197
0 commit comments