login
Forgot?
Login with Facebook

Don't have an account? Register one now!

GoToAssistant Remote Launcher - Build from sample c++ code

Bids 
10
Avg Bid
$420 USD
CLOSED
  • Project ID:

    322598
  • Project Type:

    Fixed
  • Budget:

    $250-$750 USD

Project Description:

We are using GoToAssist for a support product. It is a window sharing application made by Citrix where we can remotely access a customers computer. When an end user wants support from us, we email them a generated url. They open this url in a web browser and the GoToAssist application is downloaded and run. There is the ability to launch a support session without having to open a web browser. This is done by building a c++ application where the webrequest and download is done automatically. The sample code is already made and available. We do not have the expertise to build it.

We will pay you for creating the exe application which will take in as parameter the question (which is the access code). All other hardcoded strings will be provided.

In the end, we will need a fully working exe. We prefer to have it built in Microsoft Visual Studio. We will also need documentation on how you got it setup and running in Microsoft Visual Studio.




Here is the sample code:

/* ******************************************************************
/* This app uses the strings defined to build a single URL and
/* launches it, then handles the HTML response, then finally
/* downloads the chatlink.exe and launches it. This is meant only
/* as an example of how you might implement an automated, browserless
/* launch of a GoToAssist session.
/*
/* This sample assumes that you are using the default SmartBox,
/* where the only required field is the Question.
/*
/* Note that the values will need to be encoded for use in a URL
/* more information about this can be found at the following URL.
/*
/* http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
/*
/* And the RFC 1738 Standard for URL's
/*
/* http://www.ietf.org/rfc/rfc1738.txt
/* *************************************************************** */
/*
/* Modification History
/* Date | Who | Reason
/* ---------------------------------------------------------------------------------
/* 5/10/05 Ryan G. Creation
/* 11/22/05 Bob D. Modified to display the End Page request URL
/* 2/8/06 Bob D. Removed the previous example of parsing the HTTP
/* responses and added the parsing of the comment tag
/* CUSTOMER_SURVEY_URL from the HTML.
*/
#include <iostream>
#include <fstream>
#include <string>
#include <shlwapi.h>
#include <iphlpapi.h> //For getHost
#include <wininet.h> //For getHost
using namespace std;
//Defining a BAILOUT macro for use in the app.
#define BAILOUT if(iNetSess) InternetCloseHandle(iNetSess);
if(httpConnection) InternetCloseHandle(httpConnection);
if(httpFile) InternetCloseHandle(httpFile);
return -1;
//Function declarations for later.
string getHost(void);
string getUser(void);
//This is the hostname of the broker.
//It will preceed the rest of the url string
string host = "broker.gotoassist.com";
//This is the form action, or the url to which your app should post.
//This shouldn't ever change, except for special circumstances.
//It can be found in the HTML of your SmartBox as the form action.
string action = "/servlet/dispatch/ds/queryPost.flow";
//This is the name of your Portal.
//It can be found in the HTML of your SmartBox in a hidden HTML
//form element named "Portal".
string portal = "";//Enter your portal name here.
//This is the name of your Template.
//It can be found in the HTML of your SmartBox in a hidden HTML
//form element named "Template".
string templ = "";//Enter your template name here.
//This is the name of your Form.
//It can be found in the HTML of your SmartBox in a hidden HTML
//form element named "Form".
string form = "";//Enter your form name here.
//This is the string you to enter into the SmartBox field "Question"
//You could use one of the functions below "getHost" or "getUser"
//this demonstrates how you might acquire data from the computer, or
//your application, and inject it into the generated URL.
string question = getUser();//Enter your question here.
/*****************************************************************
Note: Depending on how your portal is configured there could be
several other "required" fields which would be setup
by your account manager. An example of this might be the
Name_First, Name_Last, etc. fields. Make sure the required
fields have data in order for this automated process to work.
*****************************************************************/
//This function gets the hostname for this computer, and returns it
//as a string. It is intended to be used as the "question" value
//in the URL string.
string getHost(void)
{
FIXED_INFO * fixedInfo;
DWORD dwSize = NULL;
fixedInfo = (FIXED_INFO*)malloc(sizeof(FIXED_INFO) );
string retVal("");
if( GetNetworkParams( fixedInfo, &dwSize ) == ERROR_BUFFER_OVERFLOW )
{
if( fixedInfo )
{
delete fixedInfo;
fixedInfo = NULL;
}
fixedInfo = (FIXED_INFO*)malloc(dwSize);
}
if( GetNetworkParams( fixedInfo, &dwSize ) == NO_ERROR )
{
char buf[128];
DWORD dwOutputSize = 128;
if(!InternetCanonicalizeUrl( fixedInfo->HostName, buf, &dwOutputSize, NULL ))
{
MessageBox(NULL, "Unable to format URL. Quitting", "G2AQuickLaunch", MB_OK | MB_ICONERROR );
return "Error";
}
retVal = buf;
}
if( fixedInfo )
{
delete fixedInfo;
fixedInfo = NULL;
}
return retVal;
}
//This function gets the name of the currently logged on user and
//returns it as a string. It is intended to be used as the "question"
//value in the URL string.
string getUser(void)
{
char buf[128];
char retBuf[128];
string retVal("");
DWORD dwOutputSize = 128;
DWORD dwBufSize = 128;
if(!GetUserName(buf, &dwBufSize))
{
MessageBox(NULL, "Unable to determine Username.", "Error", MB_OK | MB_ICONERROR);
return "Error";
}
InternetCanonicalizeUrl( buf, retBuf, &dwOutputSize, NULL);
retVal = retBuf;
return retVal;
}
//The main loop
int main()
{
//Define Session ID and query key strings
string sessID, qKey;
string response; // Used to capture response
//Create the request URL using the variables defined above.
string URL = action;
URL += "?Portal=";
URL += portal;
URL += "&Template=";
URL += templ;
URL += "&Form=";
URL += form;
URL += "&Question=";
URL += question;
string URLsav = URL; // Save for use later
//Declare some variables to be used througout the file.
HINTERNET iNetSess = NULL;
HINTERNET httpConnection = NULL;
HINTERNET httpFile = NULL;
//Start an internet session and bail out if it fails.
iNetSess = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 );
if(!iNetSess)
{
cout << "Unable to open an internet connection. Goodbye." << endl;
BAILOUT;
}
//Connect to the broker and bail out if it fails.
httpConnection = InternetConnect(iNetSess, host.c_str(), INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, NULL );
if(!httpConnection)
{
cout << "Unable to connect to requested host. Goodbye." << endl;
BAILOUT;
}
//Setup the types of http data we'll accept
LPCTSTR acceptTypes[2];
acceptTypes[0] = "*/*";
acceptTypes[1] = NULL;
//This loop makes the request, and refreshes it every 15 seconds, just like the automatic download flow.
while (true)
{
// Un-comment output line to see actual request
//cout << "HTTP Req: " << URL.c_str() << "n" << endl;
//Prepare the request and bail out if it fails.
httpFile = HttpOpenRequest(httpConnection, NULL, URL.c_str(), NULL, NULL, acceptTypes, INTERNET_FLAG_RELOAD |
INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_SECURE, 0);
if(!httpFile)
{
cout << "Unable to process document request. Goodbye." << endl;
BAILOUT;
}
//Send the request to the broker, and bail out if it fails.
if(!HttpSendRequest(httpFile, NULL, 0, NULL, 0 ))
{
cout << "Unable to send document request. Goodbye." << endl;
BAILOUT;
}
//Check the type of response we got and bail out if it fails.
TCHAR contentType[128];
DWORD dwContentTypeSize = 128;
if( !HttpQueryInfo(httpFile, HTTP_QUERY_CONTENT_TYPE, contentType, &dwContentTypeSize, 0 ) )
{
cout << "Unable to determine content type. Goodbye." << endl;
BAILOUT;
}
char readBuf[1024];
DWORD dwReadBufSize = 1024;
DWORD dwBytesRead = 0;
//If the response is a file, save it as chatlink
//This will happen when the CHATLINK_URL has been captured, which happens below
if( strcmp(contentType, "application/octet-stream") == 0 )
{
ofstream outFile;
outFile.open("chatlink.exe", ios::trunc | ios::binary);
if(!outFile)
{
cout << "Unable to write internet data to disk file. Goodbye." << endl;
BAILOUT;
}
do
{
//Read a 1024 byte chunk and bail out if it fails.
if(!InternetReadFile(httpFile, readBuf, dwReadBufSize, &dwBytesRead))
{
cout << "Unable to read internet file. Goodbye." << endl;
BAILOUT;
}
//Write the 1024 byte chunk to the file
outFile.write(readBuf, dwBytesRead);
if(!outFile)
{
cout << "Unable to write internet data to disk file. Goodbye." << endl;
BAILOUT;
}
} while (dwBytesRead);
//Close the file
outFile.close();
if(!outFile)
{
cout << "Unable to write internet data to disk file. Goodbye." << endl;
BAILOUT;
}
break;
} else {
//If the response is anything else, we're going to assume it's an HTML document
//and we want to parse it to determine if chatlink is ready to download.
// Response variable is used to capture the reply here. - RFD
do
{
//Read a 1024 byte chunk and bail out if it fails.
if(!InternetReadFile(httpFile, readBuf, dwReadBufSize, &dwBytesRead))
{
cout << "Unable to read internet file. Goodbye." << endl;
BAILOUT;
}
//Add the 1024 byte chunk to a string that we'll parse later.
response += readBuf;
} while (dwBytesRead);
//Check to see if the post failed, if so, bail out
if( response.find("QUERY_STATUS="NOT POSTED"") != string::npos )
{
cout << "Query not posted. May not be an agent logged in. Goodbye." << endl;
BAILOUT;
}
//Check to see if chatlink is ready for download. If so, change the URL for the
//next iteration of this loop to download the chatlink.exe
if( response.find("CHATLINK_URL=") != string::npos )
{
string::size_type foundChar = 0;
string::size_type urlBegin = 0;
string::size_type urlEnd = 0;
foundChar = response.find("CHATLINK_URL");
urlBegin = response.find('"', foundChar);
urlBegin++;
urlEnd = response.find('"', urlBegin);
URL = response.substr(urlBegin, (urlEnd-urlBegin));
// Un-comment to see the URL string value
//cout << "The URL is: " << endl << URL.c_str() << "n" << endl; //-RFD
continue;
}
}
//Wait 15 seconds till the next iteration
Sleep(15000);
}
//If the the chatlink exists, launch it.
if( PathFileExists("chatlink.exe") )
ShellExecute(NULL, "open", "chatlink.exe", NULL, NULL, SW_SHOWNA);
//Wait 5 seconds then issue request to broker
Sleep(5000);
// Use the original URL to obtain the CUSTOMER_SURVEY_URL
URL = URLsav;
// This loop refreshes it every 5 seconds
while (true)
{
//Prepare the request and bail out if it fails.
httpFile = HttpOpenRequest(httpConnection, NULL, URL.c_str(), NULL, NULL, acceptTypes, INTERNET_FLAG_RELOAD |
INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_SECURE, 0);
if(!httpFile)
{
cout << "Unable to process document request. Goodbye." << endl;
BAILOUT;
}
//Send the request to the broker, and bail out if it fails.
if(!HttpSendRequest(httpFile, NULL, 0, NULL, 0 ))
{
cout << "Unable to send document request. Goodbye." << endl;
BAILOUT;
}
//Check the type of response we got and bail out if it fails.
TCHAR contentType[128];
DWORD dwContentTypeSize = 128;
if( !HttpQueryInfo(httpFile, HTTP_QUERY_CONTENT_TYPE, contentType, &dwContentTypeSize, 0 ) )
{
cout << "Unable to determine content type. Goodbye." << endl;
BAILOUT;
}
char readBuf[1024];
DWORD dwReadBufSize = 1024;
DWORD dwBytesRead = 0;
// Response variable is used to capture the reply here. - RFD
response = "";
do
{
//Read a 1024 byte chunk and bail out if it fails.
if(!InternetReadFile(httpFile, readBuf, dwReadBufSize, &dwBytesRead))
{
cout << "Unable to read internet file. Goodbye." << endl;
BAILOUT;
}
//Add the 1024 byte chunk to a string that we'll parse later.
response += readBuf;
} while (dwBytesRead);
//Check to see if the post failed, if so, bail out
if( response.find("QUERY_STATUS="NOT POSTED"") != string::npos )
{
cout << "Query not posted. May not be an agent logged in. Goodbye." << endl;
BAILOUT;
}
// Look for the CUSTOMER_SURVEY_URL and extract the URL
if( response.find("CUSTOMER_SURVEY_URL=") != string::npos )
{
string::size_type foundChar = 0;
string::size_type urlBegin = 0;
string::size_type urlEnd = 0;
foundChar = response.find("CUSTOMER_SURVEY_URL");
urlBegin = response.find('"', foundChar);
urlBegin++;
urlEnd = response.find('"', urlBegin);
URL = response.substr(urlBegin, (urlEnd-urlBegin));
// Display the End Page URL string value
cout << "The End Page URL is:" << endl << "https://broker.gotoassist.com" << URL.c_str() << "n" << endl; //-RFD
break;
}
//Wait 5 seconds till the next iteration
Sleep(5000);
}
cout << endl << "Enter a character and press return to continue:" << endl;
char buf[4];
memset(&buf,0,sizeof(char)*4);
cin >> buf;
return 0;
}

Skills required:

C Programming

Project posted by:

krpcomm Canada
(1 Reviews)

Last seen:

If you are the project creator or one of the bidders, please Log In for more options.


Awarded Bids

smason1000 United States
OnQueueLogo.jpg
smason1000
United States From United States     Offline
 Accepted
$400 in 3 days 
0
over 3 years ago
4.5

3.2

1 Review
100% Completion Rate
Please see PMB for details

All Bids ()

Shot Russian Federation
Shot
Russian Federation From Russian Federation     Offline
$750 in 20 days 
0
over 3 years ago
4.3

5.8

8 Reviews
95% Completion Rate
Experience of programming on various versions of C 20+ years. Wide experience of development of client-server systems.
usamacpp Egypt
mypic.JPG
usamacpp
Egypt From Egypt     Gold Member     Online
  General Freelancer Orientation (75%, 81st percentile)
  Foundation EUFreelance.com Member
$500 in 10 days 
0
over 3 years ago
4.8

5.2

14 Reviews
56% Completion Rate
Hi I tried to compile it under MS VC++ ver 6.0. it doesn't compile correctly. Here what i can do, I can rebuild it from scratch with help from your current code. Best. Usama.
maurya19 India
maurya19
India From India     Offline
  Foundation EUFreelance.com Member
$400 in 2 days 
0
over 3 years ago
5.0

4.1

7 Reviews
84% Completion Rate
Pls check PM
Belxjander Japan
Belxjander
Japan From Japan     Offline
  Foundation EUFreelance.com Member
$420 in 4 days 
0
over 3 years ago
5.0

2.0

3 Reviews
14% Completion Rate
I will be using the Visual Studio Express edition, as available for free from MS and I can provide documentation of setup with the Vista Platform DevKit Thanks in advance for your consideration. Jeremy
sigutis Lithuania
sigutis
Lithuania From Lithuania     Offline
  General Freelancer Orientation (85%, 95th percentile)
$400 in 7 days 
0
over 3 years ago
4.8

1.6

2 Reviews
75% Completion Rate
Let me help.I am using visual c++ 2008 express edition.
freelancer291977 India
freelancer291977
India From India     Offline
  Foundation EUFreelance.com Member
$300 in 9 days 
0
over 3 years ago
I do have a very good expertise in Client-Server programming in C++.I have an experience of 8 Complete Years of programming in C++. My Complete Experience is on Visual Studio.I will tell you honestly , I am an expert i... more
I do have a very good expertise in Client-Server programming in C++.I have an experience of 8 Complete Years of programming in C++. My Complete Experience is on Visual Studio.I will tell you honestly , I am an expert in fixing bugs in already developed applications and making the applications build in case any sort of build errors. Just trust me I will do it for you. I have also implemented multithreaded communication systems interacting Several Clients and Servers for the biggest telecom company in the world,very recently and single handedly.My Gut Feel is that I will be able to deliver the product to you in 9 days(Including WeekEnds).The cost for this cannot be less than 300 Dollars. I do belive in the quality of deliverables. So there will not be any compromise in delivering a quality product for you.Please feel free to contact me in case of any queries less
letgodan Russian Federation
letgodan
Russian Federation From Russian Federation     Offline
  Foundation EUFreelance.com Member
$300 in 3 days 
0
over 3 years ago
Hi! We ca do this project. Plase see PM
robace United States
robace
United States From United States     Offline
  Foundation LimeExchange Member
$250 in 3 days 
0
over 3 years ago
I have Microsoft Visual Studio Professional edition, which has more functionality than Express or Builder. I also have experience creating instructional user documentation. See profile for level of experience.
AlexKiev Ukraine
AlexKiev
Ukraine From Ukraine     Offline
$480 in 6 days 
0
over 3 years ago
I can build Your application using C++Builder. I have experience with builder since 1999.