When you sign up you will be provided with a unique username and password and a connection string that you can use when configuring your proxy service in your application:
All requests that you make via this proxy will appear to the destination server to originate from one of the two static IPs you will be assigned when you sign up.
We recommend you store the connection string in an environment variable STATICA_URL. If you have signed up via the add-ons platform on Heroku or cloudControl this variable will be automatically set in your production environment.
This example is written in C# and uses the HttpWebRequest class to make a request via Statica.
//Extract proxy connection details string proxyUrl = Environment.GetEnvironmentVariable("STATICA_URL"); System.Uri proxyUri = new System.Uri(url); string cleanProxyURL = uri.Scheme + "://" + uri.Host+":"+uri.Port; string user = uri.UserInfo.Split(':') string password = uri.UserInfo.Split(':') HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://ip.jsontest.com/"); WebProxy myProxy = new WebProxy(); Uri newUri = new Uri(cleanProxyURL); // Associate the newUri object to 'myProxy' object so that new myProxy settings can be set. myProxy.Address = newUri; // Create a NetworkCredential object and associate it with the // Proxy property of request object. myProxy.Credentials = new NetworkCredential(user, password); request.Proxy = myProxy; HttpWebResponse httpWebResponse = request.GetResponse() as HttpWebResponse; // Get the stream containing content returned by the server. Stream dataStream = httpWebResponse.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader streamReader = new StreamReader(dataStream); // Read the content. String responseFromServer = streamReader.ReadToEnd(); // Write the content. Console.WriteLine(responseFromServer); streamReader.Close(); dataStream.Close();
We have examples for other common libraries as well, but if you can't find what you are looking for just send us a support ticket and we'll get one sent to you.