In my Javascript program, I requested this URL using the library epson-2.6.0.js
, which is the Epson SDK for JavaScript specifically designed for thermal printers. My target device is a TM U220 connected via ethernet.
GET XHR http://192.168.199.15:8008/socket.io/1/
OPTIONS XHR http://192.168.199.15/cgi-bin/epos/service.cgi [HTTP/1.1 405 Method Not Allowed 7ms]
A Cross-Origin Request was Blocked: The Same Origin Policy prevented access to the remote resource located at . (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Response headers (118 B)
Allow GET, HEAD, POST
Content-Length 0
Server Allegro-Software-RomPager/4.01
Request headers (478 B)
Accept text/html,application/xhtml+xm…plication/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en
Access-Control-Request-Headers content-type,if-modified-since,soapaction
Access-Control-Request-Method POST
Connection keep-alive
DNT 1
Host 192.168.199.15
Origin null
User-Agent Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/58.0
I have been extensively researching online for solutions to resolve this issue. Unfortunately, I am unable to modify the printer firmware for the HTTP server and can only make changes from within the JavaScript code that I have control over.