icflorescu / iisexpress-proxy

A simple local proxy for accessing IIS Express from remote machines.
ISC License
741 stars 82 forks source link

Cannot access RESTful URLs which are returning UTF8+BOM encoded JSON #8

Closed aignas closed 6 years ago

aignas commented 8 years ago

Hi,

it seems that the proxy is trying to parse JSON that is going through it. I can access static pages via the proxy without any problems, but when I am trying to access any restful services, then it fails with the following error:

Error: Parse Error
    at Error (native)
    at Socket.socketOnData (_http_client.js:309:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:531:20)

If more information is needed, please let me know.

Thanks, Ignas

icflorescu commented 8 years ago

Hi,

Not sure why you're getting this; lots of people are using the proxy to access restful services without any problems. I remember that even the application I was working on when I became motivated to build iisexpress-proxy...

The content-type should be completely irrelevant. This utility is based on Nodejitsu's http-proxy; I just had another look at the source at the only thing it's trying to parse (and could potentially cause problems) are HTTP headers.

Can you please provide a bit more context?

icflorescu commented 8 years ago

Can you please follow up or close the issue?

aignas commented 8 years ago

Sorry for the delay. I know for sure that my web server is sending the HTTP with UTF8 BOM. I will try to come up with minimal working example which is reproducing the issue at hand.

icflorescu commented 8 years ago

Ouch... UTF8 BOM? Quite a rare scenario, I guess. Feel free to put up a working example whenever you have the time, so we can notify the contributors of http-proxy...

icflorescu commented 8 years ago

Meanwhile, if you don't mind, I'll rename the issue to clarify it's BOM specific.

aignas commented 8 years ago

Yeah, sure.

On Fri, 24 Jun 2016 15:45 Ionut-Cristian Florescu, notifications@github.com wrote:

Meanwhile, if you don't mind, I'll rename the issue to clarify it's BOM specific.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/icflorescu/iisexpress-proxy/issues/8#issuecomment-228336181, or mute the thread https://github.com/notifications/unsubscribe/AAOtKjZECIQGBxe-KrSTTsQHyi-8iEezks5qO9FLgaJpZM4I0MPh .

Ignas Anikevcius http://anikevicius.lt

icflorescu commented 6 years ago

Closing this due to inactivity.