Tell me when the next post is... WebSockets!
Clojure with gniazdo, 126, 204, 203 bytes
+78 bytes to handle reacting to heartbeat messages
-1 byte by changing from indexing the string converted to a vector, to just using nth. I was expecting more of a gain from that :/

(use '[gniazdo.core])(fn[t](let[a(atom 0)s #(send-msg @a %)o(connect&quot;ws://qa.sockets.stackexchange.com&quot;:on-receive #(if(=((vec %)11)\h)(s&quot;hb&quot;)(println %)))](reset! a o)(s(str&quot;1-questions-newest-tag-&quot;t))))

An anonymous function that takes a string tag, and prints the raw JSON results as they're received, while responding to heartbeats.
To test if the received message is a heartbeat, I'm testing if the 12th character of the response is the character h. After looking over this page, it seems impossible for h to be the 12th character without the response being a heartbeat. If this isn't the case, I can try to figure out a workaround.
(ns bits.golf.web-sock
  (:require [gniazdo.core :as g]))

(defn new-tag-posts [^String tag]
  (let [; A mutable state to hold the sock.
        ; Necessary since the sock's callback requires a reference to the
        ;  sock itself
        sock-a (atom nil)

        ; Shortcut function to save bytes
        send #(g/send-msg @sock-a %)

        handler #(if (= (nth % 11) \h) ; If the 12th character (at index 11) is 'h'
                   (send &quot;hb&quot;) ; respond to the heartbeat
                   (println %)) ; else print the JSON

        sock (g/connect &quot;ws://qa.sockets.stackexchange.com&quot;
                        :on-receive handler)]

    ; Set the mutable state to the created socket
    (reset! sock-a sock)

    ; Subscribe to the given tag
    (send (str &quot;1-questions-newest-tag-&quot; tag))))