V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
rationa1cuzz
V2EX  ›  问与答

网关转发会导致跨域吗?

  •  
  •   rationa1cuzz · 2021-08-04 16:26:49 +08:00 · 1188 次点击
    这是一个创建于 967 天前的主题,其中的信息可能已经有所发展或是发生改变。
    有线网跨域
    无线网不跨域,不同网段
    11 条回复    2021-08-05 10:51:55 +08:00
    FreeEx
        1
    FreeEx  
       2021-08-04 16:36:00 +08:00
    跨域和这个没有任何关系。跨域产生的原因:出于安全性,浏览器限制脚本内发起的跨源 HTTP 请求。
    rationa1cuzz
        2
    rationa1cuzz  
    OP
       2021-08-04 16:37:54 +08:00
    @FreeEx 这个我知道,本质是浏览器不允许,我同一个网站无线网 192.168.4.11 正常访问,有线 192.168.5.101 不行,同一个网络不通网段
    juzipeek
        3
    juzipeek  
       2021-08-04 17:13:55 +08:00
    是不是增加了响应头
    mxT52CRuqR6o5
        4
    mxT52CRuqR6o5  
       2021-08-04 18:49:29 +08:00
    我感觉你描述的东西可能不叫跨域
    wellsc
        5
    wellsc  
       2021-08-04 18:53:21 +08:00
    xingyue
        6
    xingyue  
       2021-08-04 19:46:29 +08:00 via Android
    访问的页面地址是?提示跨域的接口地址是?
    rationa1cuzz
        7
    rationa1cuzz  
    OP
       2021-08-05 09:06:25 +08:00
    @mxT52CRuqR6o5
    @xingyue
    ►Access to XMLHttpRequest at ’http:ZZ192.168.101.lZpisa :xxxx/#Zlogin:1 ble/disable.htm?url type-%ETO^BFEE§%57&E%F7%ro£j$99/%49%50%E7%AB%99%E7%8 2%B9&plc name=%E6%99%AE%E9%80%9A%E5%91%98%E5%B7%A5' (redirected from ’htt p://xxxxxx/') from origin * http://xxxxx has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    ►GET http://192.168.101.lZdisableZdisable.ht chunk-vendors.0731f280.js:189 m?url type=%E8%AE%BF%E9%97%AE%E7%BD%.J»99/%49%50%E7%AB%99%E7%82%B9&plc name=% E6%99%AE%E9%80%9A%E5%91%98%E5%B7%A5 net::ERR_FAILED
    rationa1cuzz
        8
    rationa1cuzz  
    OP
       2021-08-05 09:07:12 +08:00
    @wellsc 为什么啊?
    @juzipeek 代码并没有做特殊处理
    waiaan
        9
    waiaan  
       2021-08-05 09:40:23 +08:00
    @rationa1cuzz
    跨域的话浏览器会有提示,你的不能正常访问是怎么样的?
    mxT52CRuqR6o5
        10
    mxT52CRuqR6o5  
       2021-08-05 10:34:45 +08:00
    @rationa1cuzz 看上去有些请求是写死 host 的,而不是请求当前访问的域名,尝试转发时对 body 全局替换字符串
    rationa1cuzz
        11
    rationa1cuzz  
    OP
       2021-08-05 10:51:55 +08:00
    @waiaan 7 楼
    @mxT52CRuqR6o5 都是直接访问 ip 的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5322 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:06 · PVG 16:06 · LAX 01:06 · JFK 04:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.