Bill Morefield My thoughts, discoveries, and occasional rambiings.

March 31, 2014

Port Forwarding in Windows

Filed under: web — Tags: , , — Bill Morefield @ 8:33 am

I always enjoy finding something new that meets a need. As you might guess from the title, I found myself recently needing to forward a port on a Windows server. The scenario is that I had a server I need to allow access to from an network that hadn’t been originally planned to do so. I could have just opened a firewall port, but I prefer to set up a more secured method.

For web connections this can be done using a reverse proxy pretty easily and Windows 2012 server even includes a wizard to make this easier to set up. In this case I needed to forward an arbitrary port to the same port on another server.

It turns out this functionality is built into Windows and has been since at least 2008 and the command to do so is pretty simple.

netsh interface portproxy add v4tov4 listenport=80 listenaddress 10.0.0.1 connectport=8088 connectaddress=192.168.1.75

This binds port 80 on address 10.0.0.1 on the local server and forwards any traffic received on this port to port 8088 at address 192.168.1.75. The response is also returned back through the proxy to the source server. It works quite nicely in early testing and fills a need I’ve always had trouble finding a good, reliable solution for on Windows. There are only a few limitations I’ve found so far. From my reading it seems to require IPv6 to be installed to work even if you’re not doing an IPv6 connection. It also cannot bind the localhost addresses which limits use in development scenarios. Documentation on the command is at http://technet.microsoft.com/en-us/library/cc731068%28v=ws.10%29.aspx.

As implied by the v4tov4 portion of the command, you can use this to set up proxies between IPv4 and IPv6 servers. That should come in handy when migration to the new IP version comes over the next few years.

March 25, 2014

Article Published on Tuts+ Code

Filed under: Uncategorized — Bill Morefield @ 10:39 pm

My article on Securely Handling User’s Login Credentials is up on Tuts+ Code.

For most websites, you have different areas within it (home page, user profile, admin page, etc.), some of which will be public and others will need to be restricted to only certain users. You often want to uniquely identify users so you can provide customized content or to capture specific information from a user. Many sites also need to protect part of the site, such as an administrative area to maintain and update the content of the site. In a CMS site, some users may be able to create content, but others must approve that content before it is shown to the public.

Read the Rest.

March 21, 2014

Better Weigh in the App Store

Filed under: iPhone,Programming — Tags: , — Bill Morefield @ 8:56 am

So earlier this year I decided to write an app for the iPhone. In my case I wanted to loose a little weight before working to add on some muscle for a planned summer trip. I’d not been particularly happy with anything I found to track my weight before, so I decided to write my own. Thus was born Better Weigh.

 better-weigh-screenshot

The app focuses on helping you track your weight and spot trends such as subtle weight gain before weeks of dieting is required to lose unwanted weight. It works if you’re looking to lose weight, gain weight, or just maintain your weight

Just normal changes from diet, exercise, and other activities can cause your weight to vary by several pounds per day. These daily swings make the real changes over time of your weight hard to track. Better Weigh smoothes out these variations showing you how your weight is really changing and helping you reach your goal.

You can enter your weight manually or sync with FitBit. More syncing options are planned. You can find it on the App Store or see more info at http://betterweigh.me.

Powered by WordPress