Skip to content

An HTTP proxy that naively injects NTLM data for the current user into outgoing requests

License

Notifications You must be signed in to change notification settings

mike-rogers/NtlmProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NTLM Proxy

Current status: Build status

So my team is using Selenium WebDriver to test our web application, and it takes balls forever to run on our test browser. Our test browser is Firefox, which, with a name like that, you'd think would be... I dunno, zippy.

Anyway.

I wanted to use PhantomJS to run headlessly, which would increase the speed of the test runs. Sounds good, right? Too bad we're using Windows Authentication. PhantomJS (currently, 20140205) doesn't like NTLM, and neither do I. The only way to pass Windows credentials is to use some sort of proxy.

Some sort of proxy

That's why I wrote this little library.

With a simple using directive it will create a tiny web proxy and naively forward any requests sent to it on to a target URL, with NTLM headers for the current user.

It's pretty simple to use:

    using (var proxy = new NtlmProxy(new Uri("http://localhost:8081/")))
    {
		// Make your requests here to http://localhost:3999/{0}, proxy.Port
    }

You can pass in your own custom options:

    var options = new SimpleHttpServerOptions
	{
	    Port = 3999,
		AuthenticationScheme = AuthenticationSchemes.None
	};

    using (var proxy = new NtlmProxy(new Uri("http://localhost:8081/"), options))
    {
		// Make your requests here to http://localhost:3999/whatever
    }

To see a comprehensive list of options, see the comments for SimpleHttpServerOptions.cs.

How do I install it?

You can download the zipped DLL in the Releases section above, or you can use NuGet:

  <package id="MikeRogers.NtlmProxy" version="1.2.1" targetFramework="net45" />

Why do you keep saying 'naively'?

I'm no NTLM expert, but I think after the first authorization challenge the client should be holding onto the credentials and including the appropriate NTLM headers. I'm pretty sure this proxy server won't do that.

It's still pretty cool

I know, right?

License?

As always, we rock the BSD.

About

An HTTP proxy that naively injects NTLM data for the current user into outgoing requests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages