move socket_sink and socket_source to the library
begin to generate HTML