2 Replies Latest reply on Jul 11, 2016 2:32 PM by Mont Rothstein

    Slow printing to 127.0.0.1

    Mont Rothstein

      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