title: How to config HTTPPlatformHandler of IIS for Server Sent Event (SSE, EventStream)
body: <p>Currently I have program that provide SSE as a service, and I have to deploy on IIS. But its does not work correctly, 
  Here is the result when I run .exe without IIS. </p>
  
  <pre><code>data: Hello, world
  </code></pre>
  
  <p>But when its run behind IIS, Browser was stuck on loading.
  I have to flush event <code>Hello, world</code> thousand times to make IIS flush result to browser and it's flush instantly instead of incremental update like SSE use to be. </p>
  
  <p>Here is my <code>web.config</code> </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;configuration&gt;
        &lt;system.webServer&gt;
          &lt;handlers&gt;
            &lt;add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /&gt;
          &lt;/handlers&gt;
          &lt;httpPlatform processPath=".\sse_server.exe" 
            arguments="-port=%HTTP_PLATFORM_PORT% -environment development" 
            stdoutLogEnabled="false" 
            requestTimeout="00:05:00" 
            stdoutLogFile=".\sse_server_log"&gt;
          &lt;/httpPlatform&gt;
          &lt;urlCompression doStaticCompression="true" doDynamicCompression="false" /&gt;
          &lt;caching enabled="false" enableKernelCache="false" /&gt;
        &lt;/system.webServer&gt;
      &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my <code>go</code> code</p>
  
  <pre><code>func SSEHello(rw http.ResponseWriter, flusher http.Flusher) {
      rw.Header().Set("Content-Type", "text/event-stream; charset=utf-8")
      rw.Header().Set("Cache-Control", "no-cache")
      rw.Header().Set("Connection", "keep-alive")
      rw.WriteHeader(http.StatusOK)
      for i := 0; i &lt; 1000; i++ {
          rw.Write([]byte("data:Hello, world\n\n"))
          flusher.Flush()
          time.Sleep(time.Millisecond * 100)
      }
  }
  </code></pre>