meetpatty / HENkaku-webserver

49 stars 15 forks source link

Recommandation: use url-rewrite instead of fiddler #4

Open GothicIII opened 8 years ago

GothicIII commented 8 years ago

Hi,

how about providing this web.config for the main site? (not the henkaku-app):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="Default.asp" />
                <remove value="index.htm" />
                <remove value="index.html" />
                <remove value="iisstart.htm" />
                <remove value="default.aspx" />
                <remove value="Default.htm" />
                <add value="index.html" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="Test" enabled="true" stopProcessing="true">
                    <match url="x(.*)" />
                    <action type="Redirect" url="henkaku/api/{C:0}" appendQueryString="false" redirectType="Permanent" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_URI}" pattern="henkaku(.*)" negate="true" />
                        <add input="{QUERY_STRING}" pattern="(.*)" />
                    </conditions>
                </rule>
                <rule name="Redirect" stopProcessing="true">
                    <match url="^$" />
                    <action type="Redirect" url="henkaku/" />
                </rule>
                <rule name="Install" stopProcessing="true">
                    <match url="^pkg(.*)" />
                    <action type="Redirect" url="henkaku/{R:0}" />
                </rule>
            </rules>
        </rewrite>
        <staticContent>
            <mimeMap fileExtension=".sfo" mimeType="text/plain" />
        </staticContent>
    </system.webServer>
</configuration>

Users would just have to overwrite their original one from the main page and install this.

It would make fiddler obsolete and the users wouldn't need to mess around with its config.

EDIT: Ok I see you already implemented this with node.js. Im a bit late :p