sunriselink / TelegramApi

JavaScript library for using Telegram API
GNU General Public License v3.0
75 stars 25 forks source link

No server found for dc 4 #2

Open justmisam opened 7 years ago

justmisam commented 7 years ago

Hi, When I call sendCode method, I got this error:

telegramApi.js:1182 [0.834] Error 303 PHONE_MIGRATE_4 false 2 ... Get networker error Error: No server found for dc 4(…) Error: No server found for dc 4 at Object.mtpAuth [as auth] (file:///home/misam/misam/node_modules/telegram-api-js/dist/telegramApi.js:1644:30) .... Can you help me?!

stuk88 commented 7 years ago

got the same error message.

sunriselink commented 7 years ago

Hi, you can clone your ip addr for DC 2 something like this

telegramApi.setConfig({
  ...
  server: {
    production: [
        { id: 1, host: '149.154.167.40', port: 443},
        { id: 2, host: '149.154.167.40', port: 443},
        { id: 3, host: '149.154.167.40', port: 443},
        { id: 4, host: '149.154.167.40', port: 443},
        { id: 5, host: '149.154.167.40', port: 443},
    ]
  }
});

Or may be you can take hosts from webogram repository https://github.com/zhukov/webogram/blob/82aec7a6daea93631b9eb14a89248d2b9580a906/app/js/lib/mtproto.js#L20 But I don't know whether it will work.

fjcaballero commented 7 years ago

Using the hosts from webogram repo fix the issue, ty. Also the Error 303 PHONE_MIGRATE_4 false 2 continue showing up but it doesn't seem to have any relevance on the functionality.

siyamak45 commented 7 years ago

but how to solve Error 303 PHONE_MIGRATE_4 false 2 because it prevents to load user's profile photo.