Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login gateway timeout #35

Open
bodenmethod opened this issue Apr 25, 2022 · 0 comments
Open

Login gateway timeout #35

bodenmethod opened this issue Apr 25, 2022 · 0 comments

Comments

@bodenmethod
Copy link

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.

<?php
require "vendor/autoload.php";
$client = Graze\TelnetClient\TelnetClient::factory();

 $dsn = "00.00.00.000:23";
 $client->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 = "<SPACE> for next page, <CR> 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 "<pre>";
print_r($client);
echo "</pre>";
```
```
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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant