iPhone测试:端口转发和本地主机 [英] iPhone testing: port forwarding and localhost

查看:125
本文介绍了iPhone测试:端口转发和本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在iPhone上测试我们的Web应用程序.在生命周期中,我们的应用程序正在调用第三方api,该API仅允许使用标头"origin:localhost"进行调用在桌面上这不是问题.在Android设备上,我可以设置端口转发.我可以在iPhone上做类似的事情吗?有可能吗?

I'm trying to test our web app on iPhone. During the lifecycle our app is doing a call to a third-party api which allows calls only with a header 'origin: localhost' On desktop it's not a problem. On Android I can set up port forwarding. Can I do anything similar on iPhone? Is it possible?

我找到了此答案.但它描述了一种使用 [您的PC名称] .local 这样的url的方法,这不是我所需要的

I found this answer. but it describes a way to use url like [your pc name].local which isn't what I need

推荐答案

这可能有所帮助:我正在寻找一种方法(在台式机Chrome中)检查(在台式机 localhost 上运行的)页面在通过USB连接的Android和iOS手机上,并找到本指南 https://washamdev.com/debug-a-website-in-ios-safari-on-windows/.有点混乱,但是,当遵循针对iOS11的其他步骤时,它确实起作用.我可以在桌面Chrome的检查器中看到Android Chrome和iOS Safari选项卡.可悲的是,我也可以将localhost转发到Android,而不是iOS.但是,也许这对我而言是错误的配置,您可以使其正常运行.祝你好运!

This might help: I was looking for a way to inspect (in desktop Chrome) a page (running on desktop localhost) loaded on Android and iOS phones connected via USB and found this guide https://washamdev.com/debug-a-website-in-ios-safari-on-windows/. A bit chaotic, yet, when following the additional steps for iOS11, it worked. I can see the Android Chrome and iOS Safari Tabs in desktop Chrome's inspector. I can also forward localhost to Android, sadly, not to iOS. But maybe it is a wrong configuration on my side and you can get it to work. Good luck!

这篇关于iPhone测试:端口转发和本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆