I am printing from a website as covered in this article. I want to print to 127.0.0.1 and then configure a port proxy (netsh interface portproxy) to forward the traffic to the printer. This will allow each computer to locally control the printer it uses.
My problem is that the printer (a GK420t) randomly delays printing labels, and even re-orders them, when I use 127.0.0.1. Here are the details.
I setup port proxies from 127.0.0.1 and the machine's actual IP (ex: 192.168.1.100) on port 5533 to the printer's IP (ex: 192.168.1.150) port 80.
I then run the following tests printing from a webpage using JavaScript XMLHttpRequest.
Test 1: Print directly to PRINTERIP:80, Result = prints immediately
Test 2: Print to LOCALMACHINEIP:5533, Result = prints immediately
Test 3: Print to 127.0.0.1:5533, Result = usually, but not always, delayed print. Commonly around 10 sec delay. Prints in rapid succession can be out of order.
At first I thought this was Windows and the "netsh interface portproxy" command. However I fired up Wireshark and discovered that it is the printer. I see the outbound HTTP call to the printer and then a long delay as well as out-of-order responses.
Edit 1 - More Information
I have attached the following:
SlowPrintToLocalhost.pcapng - capture using WireShark
Basic_HttpPOST_Duration.html - Only change from the original is the addition of displaying the duration
The WireShark filter I used is this:
(ip.src==192.168.1.121 or ip.dst==192.168.1.121) and (tcp.port eq 80 or tcp.port eq 5533)
To do the port forwarding I used this command from an Administrator command prompt.
netsh interface portproxy add v4tov4 listenaddress=localaddress listenport=localport connectaddress=destaddress connectport=destport
Ex:
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=5533 connectaddress=192.168.1.121 connectport=80
You can view all forwarding rules using:
netsh interface portproxy show all
You can clear all the rules using:
netsh interface portproxy reset
I got the port forwarding information from this page http://woshub.com/port-forwarding-in-windows/
Thanks
2 Replies
Hi Mont,
Thanks for the detailed question. I don't have any ideas on why this would be happening. Would you be willing to share, or send to me directly, the Wireshark traces? As I don't have a port proxy setup at the moment, it would be the best bet for troubleshooting. Otherwise it will be several days before I can get something setup to test.
Robin
I updated the post with additional information. If there is anything else I can provide please let me know.
-Mont