summaryrefslogtreecommitdiffstats
path: root/archives/extend/2015-June/000535.html
blob: e653d8cc17bfa6aad96638df356b9fa05e60a145 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [99s-extend] Help to use frameset in index.html
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Help%20to%20use%20frameset%20in%20index.html&In-Reply-To=%3C55892247.5010302%40ninenines.eu%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <style type="text/css">
       pre {
           white-space: pre-wrap;       /* css-2.1, curent FF, Opera, Safari */
           }
   </style>
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000534.html">
   <LINK REL="Next"  HREF="000536.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[99s-extend] Help to use frameset in index.html</H1>
    <B>Lo&#239;c Hoguin</B> 
    <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Help%20to%20use%20frameset%20in%20index.html&In-Reply-To=%3C55892247.5010302%40ninenines.eu%3E"
       TITLE="[99s-extend] Help to use frameset in index.html">essen at ninenines.eu
       </A><BR>
    <I>Tue Jun 23 11:09:27 CEST 2015</I>
    <P><UL>
        <LI>Previous message: <A HREF="000534.html">[99s-extend] Help to use frameset in index.html
</A></li>
        <LI>Next message: <A HREF="000536.html">[99s-extend] Help to use frameset in index.html
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#535">[ date ]</a>
              <a href="thread.html#535">[ thread ]</a>
              <a href="subject.html#535">[ subject ]</a>
              <a href="author.html#535">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Oh nice catch ahah. We should probably warn when something like this 
happens.

On 06/23/2015 11:06 AM, Graham Hay wrote:
&gt;<i> I think the order of your routes is the problem, try putting this line
</I>&gt;<i> &lt;<A HREF="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</A>&gt;
</I>&gt;<i> last.
</I>&gt;<i>
</I>&gt;<i> On 23 June 2015 at 09:56, Lo&#239;c Hoguin &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>
</I>&gt;<i> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">essen at ninenines.eu</A>&gt;&gt; wrote:
</I>&gt;<i>
</I>&gt;<i>     The {error, enoent}, especially there, is probably just because the
</I>&gt;<i>     browser is trying to fetch the favicon.
</I>&gt;<i>
</I>&gt;<i>     Your issue is that Websocket won't connect, so it has nothing to do
</I>&gt;<i>     with cowboy_rest. Try tracing cowboy_websocket or enable SASL to
</I>&gt;<i>     have more info.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>     On 06/23/2015 10:28 AM, Robert Balogh wrote:
</I>&gt;<i>
</I>&gt;<i>         hello,
</I>&gt;<i>
</I>&gt;<i>         First of all I would say I am a beginner in Cowboy web server, so
</I>&gt;<i>         probably I made something wrong, that is why I got the &quot;fault&quot;,
</I>&gt;<i>         what I got.
</I>&gt;<i>
</I>&gt;<i>         I would like to build up web page, where the client can
</I>&gt;<i>         communicate to
</I>&gt;<i>         server, and server can do the same to client, if client does not
</I>&gt;<i>         send
</I>&gt;<i>         anything to server too. The Cowboy has the websocket example,
</I>&gt;<i>         what does
</I>&gt;<i>         what I would like to do.
</I>&gt;<i>
</I>&gt;<i>         There is only one thing is missing what I would like to have.
</I>&gt;<i>         This is
</I>&gt;<i>         the &quot;frameset&quot;. My idea is to build the index.html using framsets. I
</I>&gt;<i>         made this changes, and I build up the html files for the frames,
</I>&gt;<i>         and of
</I>&gt;<i>         course I set these in the index.html.
</I>&gt;<i>
</I>&gt;<i>         Here is how the index.html looks like
</I>&gt;<i>               &lt;html&gt;
</I>&gt;<i>
</I>&gt;<i>               &lt;head&gt;
</I>&gt;<i>               &lt;title&gt;Welcome to Websocket example 2&lt;/title&gt;
</I>&gt;<i>               &lt;/head&gt;
</I>&gt;<i>
</I>&gt;<i>               &lt;frameset rows=&quot;64,*&quot;&gt;
</I>&gt;<i>                   &lt;frame name=&quot;top_frame&quot; noresize=&quot;noresize&quot; scrolling=&quot;no&quot;
</I>&gt;<i>         src=&quot;frame_top.html&quot;&gt;
</I>&gt;<i>                   &lt;frameset cols=&quot;450,*&quot;&gt;
</I>&gt;<i>                       &lt;frame name=&quot;left_frame&quot; scrolling=&quot;auto&quot;
</I>&gt;<i>         src=&quot;frame_left.html&quot;&gt;
</I>&gt;<i>                       &lt;frame name=&quot;right_frame&quot; src=&quot;frame_right.html&quot;&gt;
</I>&gt;<i>                   &lt;/frameset&gt;
</I>&gt;<i>                   &lt;noframes&gt;
</I>&gt;<i>                   &lt;body&gt;
</I>&gt;<i>
</I>&gt;<i>                   &lt;/body&gt;
</I>&gt;<i>                   &lt;/noframes&gt;
</I>&gt;<i>               &lt;/frameset&gt;
</I>&gt;<i>
</I>&gt;<i>               &lt;/html&gt;
</I>&gt;<i>
</I>&gt;<i>         This is how the priv folder looks like
</I>&gt;<i>         -----------------------------------------------------------
</I>&gt;<i>               ls priv/
</I>&gt;<i>               frame_left.html  frame_right.html  frame_top.html
</I>&gt;<i>         index.html  static
</I>&gt;<i>
</I>&gt;<i>         This is how I changed the websocket_2_app:start/2 function
</I>&gt;<i>         -----------------------------------------------------------
</I>&gt;<i>               Dispatch = cowboy_router:compile([
</I>&gt;<i>                   {'_', [
</I>&gt;<i>
</I>&gt;<i>                       {&quot;/&quot;, cowboy_static, {priv_file, websocket_2,
</I>&gt;<i>         &quot;index.html&quot;}},
</I>&gt;<i>                       {&quot;/[...]&quot;, cowboy_static, {priv_dir, websocket_2,
</I>&gt;<i>         &quot;&quot;}},
</I>&gt;<i>
</I>&gt;<i>                       {&quot;/websocket_2&quot;, ws_handler_2, []},
</I>&gt;<i>                       {&quot;/static/[...]&quot;, cowboy_static, {priv_dir,
</I>&gt;<i>         websocket_2,
</I>&gt;<i>         &quot;static&quot;}}
</I>&gt;<i>                   ]}
</I>&gt;<i>               ]),
</I>&gt;<i>
</I>&gt;<i>         After compile and make release package of the app, I can reach the
</I>&gt;<i>         webserver on the port 8080, but some connection does not set up
</I>&gt;<i>         correctly. The following texts are present in the browser
</I>&gt;<i>               DISCONNECTED
</I>&gt;<i>
</I>&gt;<i>               ERROR: undefined
</I>&gt;<i>
</I>&gt;<i>               Connecting to: <A HREF="ws://localhost:8080/websocket_2">ws://localhost:8080/websocket_2</A>
</I>&gt;<i>
</I>&gt;<i>         I made a dbg trace on all cowboy modules, to start some kind of
</I>&gt;<i>         troubleshooting. In the &quot;tons&quot; of printout I can see this one.
</I>&gt;<i>         So in the
</I>&gt;<i>         bottom of this, there is an {error,enoent}. It comes when tries
</I>&gt;<i>         connect
</I>&gt;<i>         to the socket. But unfortunatelly I do not have idea what may
</I>&gt;<i>         cause this :-(
</I>&gt;<i>
</I>&gt;<i>         The part of trace
</I>&gt;<i>         -----------------------------------------------------------
</I>&gt;<i>               (&lt;0.177.0&gt;) call
</I>&gt;<i>         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;,'HTTP/1.1',
</I>&gt;<i>                         {{127,0,0,1},33241},
</I>&gt;<i>                         &lt;&lt;&quot;localhost&quot;&gt;&gt;,undefined,8080,&lt;&lt;&quot;/websocket_2&quot;&gt;&gt;,
</I>&gt;<i>                         [&lt;&lt;&quot;websocket_2&quot;&gt;&gt;],
</I>&gt;<i>                         &lt;&lt;&gt;&gt;,undefined,[],
</I>&gt;<i>                         [{&lt;&lt;&quot;host&quot;&gt;&gt;,&lt;&lt;&quot;localhost:8080&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;connection&quot;&gt;&gt;,&lt;&lt;&quot;Upgrade&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;pragma&quot;&gt;&gt;,&lt;&lt;&quot;no-cache&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;cache-control&quot;&gt;&gt;,&lt;&lt;&quot;no-cache&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;upgrade&quot;&gt;&gt;,&lt;&lt;&quot;websocket&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;origin&quot;&gt;&gt;,&lt;&lt;&quot;<A HREF="http://localhost:8080">http://localhost:8080</A>&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;sec-websocket-version&quot;&gt;&gt;,&lt;&lt;&quot;13&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;user-agent&quot;&gt;&gt;,
</I>&gt;<i>                           &lt;&lt;&quot;Mozilla/5.0 (X11; Linux i686)
</I>&gt;<i>         AppleWebKit/537.36
</I>&gt;<i>         (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;accept-encoding&quot;&gt;&gt;,&lt;&lt;&quot;gzip, deflate, sdch&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;accept-language&quot;&gt;&gt;,&lt;&lt;&quot;en-US,en;q=0.8&quot;&gt;&gt;},
</I>&gt;<i>
</I>&gt;<i>         {&lt;&lt;&quot;sec-websocket-key&quot;&gt;&gt;,&lt;&lt;&quot;by/gwaQvb/51W7Wa9zrGQg==&quot;&gt;&gt;},
</I>&gt;<i>                          {&lt;&lt;&quot;sec-websocket-extensions&quot;&gt;&gt;,
</I>&gt;<i>                           &lt;&lt;&quot;permessage-deflate;
</I>&gt;<i>         client_max_window_bits&quot;&gt;&gt;}],
</I>&gt;<i>                         [{&lt;&lt;&quot;connection&quot;&gt;&gt;,[&lt;&lt;&quot;upgrade&quot;&gt;&gt;]}],
</I>&gt;<i>
</I>&gt;<i>         undefined,[],waiting,&lt;&lt;&gt;&gt;,undefined,false,waiting,[],&lt;&lt;&gt;&gt;,undefined},{state,[{handler,cowboy_static},
</I>&gt;<i>                       {handler_opts,{priv_dir,websocket_2,[]}},
</I>&gt;<i>                       {listener,http},
</I>&gt;<i>                       {dispatch,[{'_',[],
</I>&gt;<i>                                       [{[],[],cowboy_static,
</I>&gt;<i>
</I>&gt;<i>           {priv_file,websocket_2,&quot;index.html&quot;}},
</I>&gt;<i>
</I>&gt;<i>            {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},
</I>&gt;<i>
</I>&gt;<i>         {[&lt;&lt;&quot;websocket_2&quot;&gt;&gt;],[],ws_handler_2,[]},
</I>&gt;<i>                                        {[&lt;&lt;&quot;static&quot;&gt;&gt;,'...'],
</I>&gt;<i>                                         [],cowboy_static,
</I>&gt;<i>
</I>&gt;<i>           {priv_dir,websocket_2,&quot;static&quot;}}]}]}],
</I>&gt;<i>                      &lt;&lt;&quot;GET&quot;&gt;&gt;,cowboy_static,
</I>&gt;<i>
</I>&gt;<i>         {&lt;&lt;&quot;/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2&quot;&gt;&gt;,
</I>&gt;<i>                       {error,enoent},
</I>&gt;<i>                       []},
</I>&gt;<i>
</I>&gt;<i>         undefined,[],undefined,[],undefined,[],undefined,false,undefined,
</I>&gt;<i>                      undefined,undefined},#Fun&lt;cowboy_rest.2.41839999&gt;)
</I>&gt;<i>         (Timestamp: {1435,
</I>&gt;<i>
</I>&gt;<i>              46126,
</I>&gt;<i>
</I>&gt;<i>              935663})
</I>&gt;<i>
</I>&gt;<i>         I guess, I did something very wrong, but I did not found what is
</I>&gt;<i>         that,
</I>&gt;<i>         thus I would like to get some help from you.
</I>&gt;<i>
</I>&gt;<i>         Please find my small project in github:
</I>&gt;<i>         <A HREF="https://github.com/ethrbh/websocket_2">https://github.com/ethrbh/websocket_2</A>
</I>&gt;<i>
</I>&gt;<i>         thanks for your help,
</I>&gt;<i>         /Robi
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>         _______________________________________________
</I>&gt;<i>         Extend mailing list
</I>&gt;<i>         <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A>&gt;
</I>&gt;<i>         <A HREF="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</A>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>     --
</I>&gt;<i>     Lo&#239;c Hoguin
</I>&gt;<i>     <A HREF="http://ninenines.eu">http://ninenines.eu</A>
</I>&gt;<i>     Author of The Erlanger Playbook,
</I>&gt;<i>     A book about software development using Erlang
</I>&gt;<i>     _______________________________________________
</I>&gt;<i>     Extend mailing list
</I>&gt;<i>     <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A> &lt;mailto:<A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A>&gt;
</I>&gt;<i>     <A HREF="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</A>
</I>&gt;<i>
</I>&gt;<i>
</I>
-- 
Lo&#239;c Hoguin
<A HREF="http://ninenines.eu">http://ninenines.eu</A>
Author of The Erlanger Playbook,
A book about software development using Erlang
</PRE>


<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000534.html">[99s-extend] Help to use frameset in index.html
</A></li>
	<LI>Next message: <A HREF="000536.html">[99s-extend] Help to use frameset in index.html
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#535">[ date ]</a>
              <a href="thread.html#535">[ thread ]</a>
              <a href="subject.html#535">[ subject ]</a>
              <a href="author.html#535">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>