ARR IIS重写websocket(适用于Home Assistant)

时间:2018-03-04 19:50:27

标签: iis websocket reverse-proxy arr

我尝试为Home Assistant设置ARR内部重写。 Home Assistant目前只允许一个密码登录,我想通过Windows Forms执行此操作。到目前为止,非常好:重写工作,登录工作,但我在websockets上得到400例外,Home Assistant严重依赖它。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="http://localhost/(.*)" />
                <conditions trackAllCaptures="true">
                    <add input="{REQUEST_URI}" pattern="^/login(.*)" negate="true" />
                </conditions>
                <action type="Rewrite" url="{C:1}://192.168.1.11:8123/{R:1}" logRewrittenUrl="true" />
            </rule>
            <rule name="ReverseProxyInboundRule2" stopProcessing="true">
                <match url="ws://localhost/(.*)" />
                <conditions>
                    <add input="{CACHE_URL}" pattern="^ws://" />
                </conditions>
                <action type="Rewrite" url="ws://192.168.1.11:8123/{R:1}" />
                <serverVariables>
                    <set name="HTTP_SEC_WEBSOCKET_EXTENSIONS" value="0" />
                </serverVariables>
            </rule>
        </rules>
    </rewrite>
</system.webServer>
<system.web>
    <authentication mode="Forms">
        <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH">
        </forms>
    </authentication>
    <authorization>
        <deny users="?" />
    </authorization>
</system.web>

http有效,但是ws给了我400.有人可以帮帮我吗? 我正在使用Windows Server 2012和最新的IIS,并使用最新的Home Assistant。

0 个答案:

没有答案