Many times we hurdle on how to enable http at ESXi Servers as they are COSless and one need to update the "proxy.xml" to enable HTTP. Here are the easy steps to upload the updated proxy.xml.

Follow the below mentioned steps:

1. Download the proxy.xml from https://<hostname>/host, save a local copy.
Note: Do not rename the file.
2. Use a text editor to open the downloaded proxy.xml file.
3. Navigate to the list of endpoints in the file (identified by the <EndpointList> tag) that contains settings for the Web service supporting the SDK. The nested tags may look something like this:
...
<e id="1">
<_type>vim.ProxyService.NamedPipeServiceSpec</_type>
<accessMode>httpsWithRedirect</accessMode>
<pipeName>/var/run/vmware/proxy-sdk</pipeName>
<serverNamespace>/sdk</serverNamespace>
</e>
...
4. Change the accessMode to httpAndHttps. Alternatively, to completely disable HTTPS, you can set it to httpOnly.
5. Save your settings and close the file.
6. Upload the updated file using httpFileAccess mechanism. Please refer below C# code snippet to upload the file.

Cookie cookie = _service.CookieContainer.GetCookies(new Uri(url))[0];
String cookieString = cookie.ToString();
String httpUrl = "https://" + <hostname> + "/host/proxy.xml";
httpUrl = httpUrl.Replace("\\ ", "%20");
Console.WriteLine("Putting VM File " + httpUrl);
WebClient client = new WebClient();
NetworkCredential nwCred = new NetworkCredential();
nwCred.UserName = username;
nwCred.Password = password;
client.Credentials = nwCred;
client.Headers.Add(HttpRequestHeader.Cookie, cookieString);
client.UploadFile(httpUrl, "PUT", localpath);

Note: You need to first login using VI APIs, steal a cookie from an active session.

7. Restart the hostd management services using DCUI.

6 comments:

  1. Larry Matter said...

    Thanks for this!

    If you don't want to use C# to upload the file, you can use the RESTClient add-on for Firefox.

    First, issue a GET on https:///host to force a log in (the cookies will be managed by Firefox).
    Then change the operation to PUT to https:///host/proxy.xml, and "Open" your modified proxy.xml file to load it into the request body. Click "send" and you should get a 200 response code. You can browse normally to the proxy.xml file to verify its updated contents.

    Also, this is probably obvious, but you have to restart the management agents for this to take effect. You can do this from the console (Customize(F2), select Troubleshooting Options, then Restart Management Agents).

  2. Larry Matter said...

    Oops, don't use angle brackets in comments. In the above URLs, where it says "https:///" it should say "https://(server)/"

  3. Unknown said...

    Free and fast anonymous web browsing with these web proxy. Working fine with youtube, facebook, and many others website. check this out :

    Ninjaproxy
    Ninjaproxy
    Vtunnel
    Facebook Proxy
    Ninjacloak
    Proxy Ninja
    Air Proxy

  4. Unknown said...

    thanks website
    and you can se this video

  5. zefezfzef said...

    thanks brother for this subject hero proxy ml

  6. Send Flower Pakistan said...

    Your nice work is very attractive and impressive.

    access FileCrop in UK



Copyright 2009 InterraIT template by Blogcrowds.