summaryrefslogtreecommitdiffstats
path: root/_build/static/archives/extend/attachments/20150623/69dfc8e4/attachment-0001.html
blob: afae15ff9301444864a127b92e52dbe15a0c8297 (plain) (blame)
1
2
3
4
<tt>
&lt;div&nbsp;dir=&quot;ltr&quot;&gt;hello,&lt;br&gt;&lt;br&gt;First&nbsp;of&nbsp;all&nbsp;I&nbsp;would&nbsp;say&nbsp;I&nbsp;am&nbsp;a&nbsp;beginner&nbsp;in&nbsp;Cowboy&nbsp;web&nbsp;server,&nbsp;so&nbsp;probably&nbsp;I&nbsp;made&nbsp;something&nbsp;wrong,&nbsp;that&nbsp;is&nbsp;why&nbsp;I&nbsp;got&nbsp;the&nbsp;&quot;fault&quot;,&nbsp;what&nbsp;I&nbsp;got.&lt;br&gt;&lt;br&gt;I&nbsp;would&nbsp;like&nbsp;to&nbsp;build&nbsp;up&nbsp;web&nbsp;page,&nbsp;where&nbsp;the&nbsp;client&nbsp;can&nbsp;communicate&nbsp;to&nbsp;server,&nbsp;and&nbsp;server&nbsp;can&nbsp;do&nbsp;the&nbsp;same&nbsp;to&nbsp;client,&nbsp;if&nbsp;client&nbsp;does&nbsp;not&nbsp;send&nbsp;anything&nbsp;to&nbsp;server&nbsp;too.&nbsp;The&nbsp;Cowboy&nbsp;has&nbsp;the&nbsp;websocket&nbsp;example,&nbsp;what&nbsp;does&nbsp;what&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;do.&lt;br&gt;&lt;br&gt;There&nbsp;is&nbsp;only&nbsp;one&nbsp;thing&nbsp;is&nbsp;missing&nbsp;what&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;have.&nbsp;This&nbsp;is&nbsp;the&nbsp;&quot;frameset&quot;.&nbsp;My&nbsp;idea&nbsp;is&nbsp;to&nbsp;build&nbsp;the&nbsp;index.html&nbsp;using&nbsp;framsets.&nbsp;I&nbsp;made&nbsp;this&nbsp;changes,&nbsp;and&nbsp;I&nbsp;build&nbsp;up&nbsp;the&nbsp;html&nbsp;files&nbsp;for&nbsp;the&nbsp;frames,&nbsp;and&nbsp;of&nbsp;course&nbsp;I&nbsp;set&nbsp;these&nbsp;in&nbsp;the&nbsp;index.html.&nbsp;&lt;br&gt;&lt;br&gt;Here&nbsp;is&nbsp;how&nbsp;the&nbsp;index.html&nbsp;looks&nbsp;like&lt;br&gt;   &nbsp;&lt;html&gt;&lt;br&gt;&lt;br&gt;   &nbsp;&lt;head&gt;&lt;br&gt;   &nbsp;&lt;title&gt;Welcome&nbsp;to&nbsp;Websocket&nbsp;example&nbsp;2&lt;/title&gt;&lt;br&gt;   &nbsp;&lt;/head&gt;&lt;br&gt;&lt;br&gt;   &nbsp;&lt;frameset&nbsp;rows=&quot;64,*&quot;&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;frame&nbsp;name=&quot;top_frame&quot;&nbsp;noresize=&quot;noresize&quot;&nbsp;scrolling=&quot;no&quot;&nbsp;src=&quot;frame_top.html&quot;&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;frameset&nbsp;cols=&quot;450,*&quot;&gt;&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;&lt;frame&nbsp;name=&quot;left_frame&quot;&nbsp;scrolling=&quot;auto&quot;&nbsp;src=&quot;frame_left.html&quot;&gt;&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;&lt;frame&nbsp;name=&quot;right_frame&quot;&nbsp;src=&quot;frame_right.html&quot;&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;/frameset&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;noframes&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;body&gt;&lt;br&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;/body&gt;&lt;br&gt;   &nbsp;   &nbsp;&lt;/noframes&gt;&lt;br&gt;   &nbsp;&lt;/frameset&gt;&lt;br&gt;&lt;br&gt;   &nbsp;&lt;/html&gt;&lt;br&gt;&lt;br&gt;This&nbsp;is&nbsp;how&nbsp;the&nbsp;priv&nbsp;folder&nbsp;looks&nbsp;like&lt;br&gt;-----------------------------------------------------------&lt;br&gt;   &nbsp;ls&nbsp;priv/&lt;br&gt;   &nbsp;frame_left.html &nbsp;frame_right.html &nbsp;frame_top.html &nbsp;index.html &nbsp;static&lt;br&gt;&lt;br&gt;This&nbsp;is&nbsp;how&nbsp;I&nbsp;changed&nbsp;the&nbsp;websocket_2_app:start/2&nbsp;function&lt;br&gt;-----------------------------------------------------------&lt;br&gt;   &nbsp;Dispatch&nbsp;=&nbsp;cowboy_router:compile([&lt;br&gt;   &nbsp;   &nbsp;{&#39;_&#39;,&nbsp;[&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{&quot;/&quot;,&nbsp;cowboy_static,&nbsp;{priv_file,&nbsp;websocket_2,&nbsp;&quot;index.html&quot;}},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{&quot;/[...]&quot;,&nbsp;cowboy_static,&nbsp;{priv_dir,&nbsp;websocket_2,&nbsp;&quot;&quot;}},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{&quot;/websocket_2&quot;,&nbsp;ws_handler_2,&nbsp;[]},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{&quot;/static/[...]&quot;,&nbsp;cowboy_static,&nbsp;{priv_dir,&nbsp;websocket_2,&nbsp;&quot;static&quot;}}&lt;br&gt;   &nbsp;   &nbsp;]}&lt;br&gt;   &nbsp;]),&lt;br&gt;&lt;br&gt;After&nbsp;compile&nbsp;and&nbsp;make&nbsp;release&nbsp;package&nbsp;of&nbsp;the&nbsp;app,&nbsp;I&nbsp;can&nbsp;reach&nbsp;the&nbsp;webserver&nbsp;on&nbsp;the&nbsp;port&nbsp;8080,&nbsp;but&nbsp;some&nbsp;connection&nbsp;does&nbsp;not&nbsp;set&nbsp;up&nbsp;correctly.&nbsp;The&nbsp;following&nbsp;texts&nbsp;are&nbsp;present&nbsp;in&nbsp;the&nbsp;browser&lt;br&gt;   &nbsp;DISCONNECTED&lt;br&gt;&lt;br&gt;   &nbsp;ERROR:&nbsp;undefined&lt;br&gt;&lt;br&gt;   &nbsp;Connecting&nbsp;to:&nbsp;ws://localhost:8080/websocket_2&lt;br&gt;&lt;br&gt;I&nbsp;made&nbsp;a&nbsp;dbg&nbsp;trace&nbsp;on&nbsp;all&nbsp;cowboy&nbsp;modules,&nbsp;to&nbsp;start&nbsp;some&nbsp;kind&nbsp;of&nbsp;troubleshooting.&nbsp;In&nbsp;the&nbsp;&quot;tons&quot;&nbsp;of&nbsp;printout&nbsp;I&nbsp;can&nbsp;see&nbsp;this&nbsp;one.&nbsp;So&nbsp;in&nbsp;the&nbsp;bottom&nbsp;of&nbsp;this,&nbsp;there&nbsp;is&nbsp;an&nbsp;{error,enoent}.&nbsp;It&nbsp;comes&nbsp;when&nbsp;tries&nbsp;connect&nbsp;to&nbsp;the&nbsp;socket.&nbsp;But&nbsp;unfortunatelly&nbsp;I&nbsp;do&nbsp;not&nbsp;have&nbsp;idea&nbsp;what&nbsp;may&nbsp;cause&nbsp;this&nbsp;:-(&lt;br&gt;&lt;br&gt;The&nbsp;part&nbsp;of&nbsp;trace&lt;br&gt;-----------------------------------------------------------&lt;br&gt;   &nbsp;(&lt;0.177.0&gt;)&nbsp;call&nbsp;cowboy_rest:next({http_req,#Port&lt;0.646&gt;,ranch_tcp,keepalive,&lt;0.177.0&gt;,&lt;&lt;&quot;GET&quot;&gt;&gt;,&#39;HTTP/1.1&#39;,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;{{127,0,0,1},33241},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;&lt;&lt;&quot;localhost&quot;&gt;&gt;,undefined,8080,&lt;&lt;&quot;/websocket_2&quot;&gt;&gt;,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;[&lt;&lt;&quot;websocket_2&quot;&gt;&gt;],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;&lt;&lt;&gt;&gt;,undefined,[],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;[{&lt;&lt;&quot;host&quot;&gt;&gt;,&lt;&lt;&quot;localhost:8080&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;connection&quot;&gt;&gt;,&lt;&lt;&quot;Upgrade&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;pragma&quot;&gt;&gt;,&lt;&lt;&quot;no-cache&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;cache-control&quot;&gt;&gt;,&lt;&lt;&quot;no-cache&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;upgrade&quot;&gt;&gt;,&lt;&lt;&quot;websocket&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;origin&quot;&gt;&gt;,&lt;&lt;&quot;&lt;a&nbsp;href=&quot;http://localhost:8080&quot;&gt;http://localhost:8080&lt;/a&gt;&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;sec-websocket-version&quot;&gt;&gt;,&lt;&lt;&quot;13&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;user-agent&quot;&gt;&gt;,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;&lt;&lt;&quot;Mozilla/5.0&nbsp;(X11;&nbsp;Linux&nbsp;i686)&nbsp;AppleWebKit/537.36&nbsp;(KHTML,&nbsp;like&nbsp;Gecko)&nbsp;Chrome/40.0.2214.115&nbsp;Safari/537.36&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;accept-encoding&quot;&gt;&gt;,&lt;&lt;&quot;gzip,&nbsp;deflate,&nbsp;sdch&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;accept-language&quot;&gt;&gt;,&lt;&lt;&quot;en-US,en;q=0.8&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;sec-websocket-key&quot;&gt;&gt;,&lt;&lt;&quot;by/gwaQvb/51W7Wa9zrGQg==&quot;&gt;&gt;},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;sec-websocket-extensions&quot;&gt;&gt;,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;&lt;&lt;&quot;permessage-deflate;&nbsp;client_max_window_bits&quot;&gt;&gt;}],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;[{&lt;&lt;&quot;connection&quot;&gt;&gt;,[&lt;&lt;&quot;upgrade&quot;&gt;&gt;]}],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp;undefined,[],waiting,&lt;&lt;&gt;&gt;,undefined,false,waiting,[],&lt;&lt;&gt;&gt;,undefined},{state,[{handler,cowboy_static},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{handler_opts,{priv_dir,websocket_2,[]}},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{listener,http},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{dispatch,[{&#39;_&#39;,[],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;[{[],[],cowboy_static,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; &nbsp;{priv_file,websocket_2,&quot;index.html&quot;}},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; {[&#39;...&#39;],[],cowboy_static,{priv_dir,websocket_2,[]}},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; {[&lt;&lt;&quot;websocket_2&quot;&gt;&gt;],[],ws_handler_2,[]},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; {[&lt;&lt;&quot;static&quot;&gt;&gt;,&#39;...&#39;],&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; &nbsp;[],cowboy_static,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp; &nbsp;{priv_dir,websocket_2,&quot;static&quot;}}]}]}],&lt;br&gt;   &nbsp;   &nbsp;  &nbsp;&lt;&lt;&quot;GET&quot;&gt;&gt;,cowboy_static,&lt;br&gt;   &nbsp;   &nbsp;  &nbsp;{&lt;&lt;&quot;/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2&quot;&gt;&gt;,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;{error,enoent},&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;[]},&lt;br&gt;   &nbsp;   &nbsp;  &nbsp;undefined,[],undefined,[],undefined,[],undefined,false,undefined,&lt;br&gt;   &nbsp;   &nbsp;  &nbsp;undefined,undefined},#Fun&lt;cowboy_rest.2.41839999&gt;)&nbsp;(Timestamp:&nbsp;{1435,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;  &nbsp;46126,&lt;br&gt;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;   &nbsp;  &nbsp;935663})&lt;br&gt;&lt;br&gt;I&nbsp;guess,&nbsp;I&nbsp;did&nbsp;something&nbsp;very&nbsp;wrong,&nbsp;but&nbsp;I&nbsp;did&nbsp;not&nbsp;found&nbsp;what&nbsp;is&nbsp;that,&nbsp;thus&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;get&nbsp;some&nbsp;help&nbsp;from&nbsp;you.&lt;br&gt;&lt;br&gt;Please&nbsp;find&nbsp;my&nbsp;small&nbsp;project&nbsp;in&nbsp;github:&nbsp;&lt;a&nbsp;href=&quot;https://github.com/ethrbh/websocket_2&quot;&gt;https://github.com/ethrbh/websocket_2&lt;/a&gt;&lt;br&gt;&lt;br&gt;thanks&nbsp;for&nbsp;your&nbsp;help,&lt;br&gt;/Robi&lt;br&gt;&lt;br&gt;&lt;/div&gt;
<br>

</tt>