Created
November 22, 2012 14:37
-
-
Save remko/4131484 to your computer and use it in GitHub Desktop.
Connecting over BOSH with Swiften
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Swiften/Swiften.h> | |
using namespace Swift; | |
int main(int, char**) { | |
SimpleEventLoop eventLoop; | |
BoostNetworkFactories networkFactories(&eventLoop); | |
Client* client = new Client("[email protected]", "mypassword", networkFactories); /* Substituting the JID and password accordingly. */ | |
ClientOptions options; | |
options.boshURL= URL::fromString("http://server.lit/http-bind/"); /* Substituting the correct URL to the BOSH endpoint */ | |
options.boshHTTPConnectProxyURL = URL::fromString("https://wwwproxy.server.lit:8080/"); /* Substituting the host/port for those of the proxy */ | |
options.boshHTTPConnectProxyAuthID = "proxy username"; /* substituting the user name needed to authenticate with the proxy. Remove this line if the proxy doesn't require authentication */ | |
options.boshHTTPConnectProxyAuthPassword = "proxy password"; /* substituting the user password needed to authenticate with the proxy. Remove this line if the proxy doesn't require authentication */ | |
/* Insert here whatever handlers you want for receiving messages etc. - see http://swift.im/swiften/guide/ */ | |
client->connect(options); | |
eventLoop.run(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment