xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
575 stars 129 forks source link

Invalid URI specified at Amp\Uri\Uri::__construct #23

Closed Maverick1983 closed 4 years ago

Maverick1983 commented 4 years ago

I update all, when I start server.php with php server.php --session=* I have this error:

PHP Fatal error:  Uncaught Amp\Uri\InvalidUriException: Invalid URI specified at Amp\Uri\Uri::__construct Argument 1: tcp://: in /root/TelegramApiServer/vendor/amphp/uri/src/Uri.php:33

Stack trace:
#0 /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Stream/ConnectionContext.php(151): Amp\Uri\Uri->__construct()
#1 /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Stream/Proxy/SocksProxy.php(69): danog\MadelineProto\Stream\ConnectionContext->setUri()
#2 [internal function]: danog\MadelineProto\Stream\Proxy\SocksProxy->connectGenerator()
#3 /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Coroutine.php(77): Generator->current()
#4 /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php(429): danog\MadelineProto\Coroutine->__construct()
#5 /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Stream/Async/Stream.php(35): danog\MadelineProto\Tools::call()
#6 /root/TelegramApiServer/vendor/danog/madelineprot in /root/TelegramApiServer/vendor/danog/madelineproto/src/danog/MadelineProto/Tools.php on line 329

I use madeline direct and I see this:

Trying shared connection via tcp://[2001:0b28:f23f:f005:0000:0000:0000:000a]:443 main DC 5, via ipv6 using AbridgedStream => BufferedRawStream => DefaultStream (-1)

With your code, I see this:

Trying shared connection via tcp://[2001:0b28:f23d:f001:0000:0000:0000:000a]:443 main DC 1, via ipv6 using AbridgedStream => SocksProxy ({"address":false,"port":false,"username":false,"password":false}) => BufferedRawStream => DefaultStream (-1)

xtrime-ru commented 4 years ago

Thanks! Error here: https://github.com/xtrime-ru/TelegramApiServer/blob/a9b118d5b2b6cee1cb7ec394da1fb15e4fd83191/config.php#L50

Missed [“telegram”]. Will fix today.

xtrime-ru commented 4 years ago

Fixed: 0e4e0b84dd7d2db6ce7bdee074cbb91a4800e696