Edit in JSFiddle

// Sending message
$('#sendBtn').click(function() {
  $.post(linkUrl, $('#msgInput').val());
  $('#msgInput').val(null);
})

// Receiving message
var receive = function() {	
  $.get(linkUrl).done(function(data) {
    $('#receivedData').append(data + '<br>');
    receive();
  })
}

var linkUrl;
$('#channelInput').on('change keyup', function() {
  linkUrl = 'https://httprelay.io/link/' + $('#channelInput').val();
  $('.linkContainer').html(linkUrl)
})

// Generating random channel id
$('#channelInput').val(Math.random().toString(36).substr(4)).trigger('change')

receive();
<fieldset>
  <legend>Communication channel ID (must be unique and secret)</legend>
  <label target="channelInput">http://httprelay.io/link/<label/><input id="channelInput"> 
</fieldset><br>

<fieldset>
  <legend>Send information to POST <span class="linkContainer"></span></legend>
  <input id="msgInput" placeholder="Message">
  <button id="sendBtn">Send</button>
</fieldset><br>

<fieldset id="receivedData">
  <legend>Received information from GET <span class="linkContainer"></span></legend>
</fieldset>
* {
    font-family: "Trebuchet MS", Helvetica, sans-serif;
    color: #555;
}