Skip to content

Instantly share code, notes, and snippets.

@remko
Created November 22, 2012 14:40

Revisions

  1. remko revised this gist Nov 22, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.cpp
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ int main(int, char**) {
    Client* client = new Client("me@server.lit", "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.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 */
  2. remko created this gist Nov 22, 2012.
    23 changes: 23 additions & 0 deletions gistfile1.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #include <Swiften/Swiften.h>

    using namespace Swift;

    int main(int, char**) {
    SimpleEventLoop eventLoop;
    BoostNetworkFactories networkFactories(&eventLoop);

    Client* client = new Client("me@server.lit", "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;
    }