|
|
|
The magic is in setting the `Content Type` header to `text/event-stream`, writing the response in the from of `data: %s \n\n`, and flushing the content of the WriteResponse buffer manually. This is necessary because by default Go will implicitly flush the buffer only once the Handler has returned.
|
|
|
|
The magic is in setting the `Content Type` header to `text/event-stream`, writing the response in the from of `data: %s \n\n`, and flushing the content of the WriteResponse buffer manually. This is necessary because by default Go will implicitly flush the buffer only once the Handler has returned.
|