Is there a way other than templates to communicate between Go and html pages ? Using something like postmessages ?
Scenario ::--> Streaming Twitter Api
Streaming api call, updates with new content as and when available;
Want to update the web page with the latest content, keeping the original content as it is.
Want to avoid using NaCl... As it is only for chrome
You can use websockets (WebSocket@Wikipedia).
Here are 2 implementations:
And here is an exhausting list of other websocket packages/implementations:
Use websockets or server sent events to push events from the server to the browser client.
Use the gorilla/websocket package for websockets. The x/net/websocket package is also available, but it's partial implementation of the protocol does not work with recent versions of Chrome.
Server sent events are so simple that a helper package is not really needed. See this example to get started with server sent events.
It's not about Go. Client side i.e. browser must be capable to handle persistent connection. So nothing new here. You have
Either technics can be easily implemented with Go on server side. Nothing tricky.
为什么都喜欢用英文。。。。。