TCP proxying on Linux

by Jon Davis 28. April 2011 10:59

Several months ago I cobbled together a port-modified TCP proxy that runs on the .NET CLR. My intention was to make this usable both in Windows and on *nix systems with Mono. I haven't used it much, though, certainly not in commercial production apps.

However, it appears that *nix already has a couple solutions already in place:



There's also SSH tunneling, which is interesting. 

I'm just short of content, however. As a future change I wanted, and still want, to detect HTTP traffic and to hijack the HTTP headers with an insertion of a custom HTTP header indicating the source IP address. I had done this previously using Apache's proxy but I was hoping to make HTTP detected rather than assumed. I'll see if I ever get around to it.

HTML5 Boilerplate Visual Studio 2010 Template

by Jon Davis 24. April 2011 09:38

So a month or two ago I was hanging out in the jQuery IRC channel on Freenode trying to sort out what was going on with the jQuery team’s support for jQuery Templates, when in enters Paul Irish. Various members of the channel congratulate Paul for his “boilerplate release”. I didn’t know who Paul Irish is nor what this “boilerplate” was. After a couple more minutes I discovered what was going on: is what was going on.

HTML5 Boilerplate is, well, an HTML 5 boilerplate, that does a number of things. Among them, ..

  1. It provides a baseline HTML 5 markup and CSS skeleton that performs a CSS reset and readies the browsers for clean design.
  2. It encapsulates the Internet Explorer versioning discrepancies by using CSS classifications instead of disparate CSS files.
  3. It readies a web site to be hyper-optimized using post-build minifications of script and CSS files and by optimizing all PNG files.
  4. It sets appropriate placeholders for a few expected files for a web site that are often forgotten, including robots.txt, crossdomain.xml, favicon.ico, and a custom 404 page.
  5. It adds PNG support to IE6 via script.

I told Paul that someone should produce a Visual Studio template based on this. He pointed me to a URL of one such template. I tried to use it, but, alas, it was doing some [completely unnecessary, I might add] OpenID stuff based on an unreleased beta version of a .NET assembly that didn’t work on my machine. So I abandoned this “solution” and walked away.

Yesterday I pulled up the Extension Gallery in Visual Studio and found the same solution plus another one just like it. Both of them were mixing in OpenID support with the HTML5 Boilerplate. The new one also has the obnoxious name prefix “MotherEffin ..”.

I will refrain from ranting about the unnecessary pooling of disparate components that can easily be installed with NuGet (or otherwise developed and deployed via NuGet). All I wanted was a clean ASP.NET MVC 3 template with the clean HTML 5 Boilerplate. Is that too much to ask?

Neither of these, to my knowledge, performed any post-build optimizations, either, which was kind of the most important part.

So I created one myself. It is based on the MVC 3 Refresh (v3.01) + VS Service Pack 1. It does move away from Paul’s design somewhat to make it more ASP.NET MVC-like in structure. It performs post-build optimization of scripts and of CSS files using Microsoft’s Ajax Minifier instead of YUI Compressor (only to eliminate the Java/non-.NET dependency; you can always restore any minifier you like). Unfortunately, I was unable to invoke NuGet to reinstall the Entity Framework 4.1 and other dependencies, so users of this template will have to manually install those; these are normally auto-installed with ASP.NET MVC 3.01 (Refresh) projects but Microsoft has not yet documented their method of doing so. Best I could find was this which wasn’t sufficiently descriptive.

One more thing. I’m certain I left some stuff out! That ant build script (build.xml) had plenty going on. There is certainly no HTML minification in my implementation.

Anyway, I did this in one evening and this is the first version of this template (think v0.1).

Here it is, for your enjoyment; put it in C:\Users\{username}\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual Web Developer\Web\.
That last \Web\ directory may not exist, just create it. Also, leave it in place as a .zip file; do not extract it.

It’ll be the among the Web project templates in “File”->”New”->”Project...” alongside the usual ASP.NET MVC 3 bits. Be sure to select .NET Framework 4.0.

Here’s the source.

If enough people like it I’ll get it packaged and posted on the VS Extensions gallery.



Currently rated 4.8 by 6 people

  • Currently 4.833333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5



Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar