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

TimeOut Connect Google Hangout #2

Open
jrpikong opened this issue Mar 1, 2019 · 7 comments
Open

TimeOut Connect Google Hangout #2

jrpikong opened this issue Mar 1, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@jrpikong
Copy link

jrpikong commented Mar 1, 2019

Hi @Norgul , I use your library and I try to connect with Google Hangout with this config

use Norgul\Xmpp\Options;
use Norgul\Xmpp\XmppClient;

class XmppController extends Controller
{
    protected static $host     = 'gmail.com';
    protected static $port     = 5222;
    protected static $username = 'user_gmail'; // user_gmail@gmail.com
    protected static $password = 'password_gmail';
    public function __construct()
    {
        ini_set('display_errors', 1);
        ini_set('display_startup_errors', 1);
        error_reporting(E_ALL);
    }
    public function getMessage()
    {
        $options = new Options();
        $options
            ->setHost(self::$host)
            ->setPort(self::$port)
            ->setUsername(self::$username)
            ->setPassword(self::$password);
        $client = new XmppClient($options);
        $client->connect();
        $client->getRoster();
        $client->sendMessage('Hello world', 'test@jabber.com');
        $client->getResponse();
        do {
            $client->getResponse();
        } while (true);
    }
}

but always request time out.
can you help me ?

@Norgul
Copy link
Collaborator

Norgul commented Mar 1, 2019

Hi @jrpikong
would you mind telling me what version of the library are you using?

@jrpikong
Copy link
Author

jrpikong commented Mar 1, 2019

Hi @Norgul thank for your fast response,
this my version :
"norgul/xmpp-php": "^1.1",

@Norgul Norgul self-assigned this Mar 1, 2019
@Norgul Norgul added the bug Something isn't working label Mar 1, 2019
@Norgul
Copy link
Collaborator

Norgul commented Mar 1, 2019

@jrpikong first thing to notice is that you are using wrong host. For Google hangouts, the host should be talk.google.com.

As for the timeout, I am pretty sure Google has some better verification system besides PLAIN :) This is something I will need to take on and research, and implement new verification which can pass Google security issues.

On the side note, I tried to register myself to XMPP over Adium (it is like Pidgin, but for Mac) with my Google credentials and couldn't do so until I have enabled less secure apps in my Google account.

I'll get on it these days and try to make it work. You are also free to check out and contribute if you have some ideas.

@Norgul Norgul added enhancement New feature or request and removed bug Something isn't working labels Mar 1, 2019
@jrpikong
Copy link
Author

jrpikong commented Mar 1, 2019

I will wait dude

@Norgul
Copy link
Collaborator

Norgul commented Mar 4, 2019

Hello again @jrpikong,
if you'd like to see the output of the library, you can forward a flag to $client->getResponse() method ($client->getResponse(true)).

I have tried again (with talk.google.com host) and what I get is the following response:

HTTP/1.1 301 Moved Permanently
Location: https://hangouts.google.com/

Even though some people say it is (was) possible to connect to the server, and even though I didn't implement TLS I am not sure at this point that I got the real host.

Still on it, but if you find out something useful I'd appreciate if you wrote it here.
Thanks

@Norgul
Copy link
Collaborator

Norgul commented Mar 25, 2019

I am closing this issue as I didn't found any resource pointing me in the right direction. oAuth2 may be implemented in future releases

@Norgul Norgul closed this as completed Mar 25, 2019
@Norgul
Copy link
Collaborator

Norgul commented Apr 23, 2019

I am reopening this issue. I had a bug (resolved now) which disabled the communication with google servers. Right host is talk.l.google.com. I will look to implement Google auth in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants