flexn-io / renative

🚀🚀🚀 Unified Development Platform for iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
https://renative.org
MIT License
1.8k stars 180 forks source link

Proxy tizen and webos on browser with charles #1111

Open williamtdepaula opened 11 months ago

williamtdepaula commented 11 months ago

Hello everyone.

I am trying to proxy my app on browser. I am using the script NODE_ENV=preprod rnv run -p tizen --hosted --hostIp 127.0.0.1 --port 3000 to run app on browser. If I open the localhost:3000, everything is ok. But I need proxy my app to a url https https://www.clarotvmais.com.br/ to do authenticated requests with cookies. I am using charles for this. I configured the map remote, but when I open it in the browser, I receive "Invalid Host Header".

Charles - Map remote Captura de Tela 2023-09-20 às 12 45 29

Browser Captura de Tela 2023-09-20 às 12 45 02

Charles when try to load page Captura de Tela 2023-09-20 às 12 44 05

Can you help me please?

pauliusguzas commented 11 months ago

@williamtdepaula thanks for reporting this, could you provide more info like, rnv version, node version?

williamtdepaula commented 11 months ago

Hello, we're using node 16.14.0 and rnv 0.34.0.

Apparently, we resolved this problem, but we yet need do a proxy on devServer like this: https://v4.webpack.js.org/configuration/dev-server/#devserverproxy

But we had no effects. Captura de Tela 2023-09-25 às 12 14 22

But we would like to use a middleware, where we can use a middleware in express like this: https://www.npmjs.com/package/http-proxy-middleware. We didn't find

OBS. (I don't know if when we build app for tizen/webos, it uses express)