graze / graze/telnet-client

Login gateway timeout

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
48
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I am trying to use the telnet-client to display a cli replica output. Below is the commands I need to execute but I don't appear to get a connection.

````
connect($dsn, "login:");

$command1 = "LOGIN";
$prompt = "password:";
$resp1 = $client->execute($command1, $prompt);

var_dump($resp1);

$command2 = "PASSWORD";
$prompt = "FOC-LABS-02>";
$resp2 = $client->execute($command2, $prompt);

var_dump($resp2);

$command3 = "bridge show";
$prompt = " for next page, for next line, A for all, Q to quit";
$resp3 = $client->execute($command3, $prompt);

var_dump($resp3);

$command4 = "a";
$prompt = "[0-9] Bridge Interfaces displayed"; // this is the last word displayed after all data is returned
$resp4 = $client->execute($command4, $prompt);

var_dump($resp4);
```

When I just run the connect code
```
$dsn = "10.45.10.100:23";
$client->connect($dsn);

echo "

";

print_r($client);
echo "
";
```
```
The response is
Graze\TelnetClient\TelnetClient Object
(
[socketFactory:protected] => Socket\Raw\Factory Object
(
)

[promptMatcher:protected] => Graze\TelnetClient\PromptMatcher Object
(
[matches:protected] => Array
(
)

[responseText:protected] =>
)

[interpretAsCommand:protected] => Graze\TelnetClient\InterpretAsCommand Object
(
[WILL:protected] => �
[WONT:protected] => �
[DO:protected] => �
[DONT:protected] => �
[IAC:protected] => �
)

[prompt:protected] => \$
[promptError:protected] => ERROR
[lineEnding:protected] =>

[maxBytesRead:protected] => 0
[socket:protected] => Socket\Raw\Socket Object
(
[resource:Socket\Raw\Socket:private] => Socket Object
(
)

)

[buffer:protected] =>
[NULL:protected] =>
[DC1:protected] => 
[IAC:protected] =>
)
```
I'm not sure what to look for, any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.