Transfer other Data Types by QUIC

1,795 views
Skip to first unread message

Mamoun Mansour

unread,
Jan 1, 2016, 3:29:08 PM1/1/16
to proto...@chromium.org
Hi,

Happy new Year .

I try to transfer other types of data like (video , images, ....) from QUIC server to client , is this applicable and how as there is a certificate when transfer ?

Best Regards

Fatima Zarinni

unread,
Jan 1, 2016, 6:30:46 PM1/1/16
to proto...@chromium.org
Hi Ma'moun,

I know that we can transfer images. The same certificate that we used for transferring the index.html file can still be used for other file types such as images. 

Thank you,
Fatima  

 


--
You received this message because you are subscribed to the Google Groups "QUIC Prototype Protocol Discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proto-quic+...@chromium.org.
To post to this group, send email to proto...@chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Fatima Zarinni

unread,
Jan 1, 2016, 6:46:52 PM1/1/16
to proto...@chromium.org
Also the certificate is used in the same way as TLS to authenticate the server. So, it should not have anything to do with the types of data files that are transferred.

Best regards,
Fatima 

Amit Srivastava

unread,
Jan 2, 2016, 4:35:27 PM1/2/16
to proto...@chromium.org
Hi Fatima,

I was wondering if there is any need to modify the the client or the server code for this purpose?
I also want to test the file transfer feature by using image file, songs or video files.

Amit

Wesley Davison

unread,
Jan 4, 2016, 12:46:24 PM1/4/16
to proto-quic
Amit, I guess you can transfer other types of content. Just use the same technique of appending the pre-header, in the beginning of the file, as it is done to html files. In the past, I tested with css, js, jpeg and svg, and it worked like a charm!

Amit Srivastava

unread,
Jan 13, 2016, 11:31:55 PM1/13/16
to proto...@chromium.org
Hi Wesley ,


Thanks for replying. I need some help with 2 issues.
I have created a custom page and kept it in a folder just like example.org has the index.html. But I have 2 image files as part of the index.html of this new webpage.
When I run the toy server with the new website I get 2 issues. One, at the receiving end I get the index.html page but not the image files.


And the other is that of late, I am getting the following error message on the server 

asrivas2@ubuntu:~/chromium/src$ ./out/Debug/quic_server --certificate_file=net/tools/quic/certs/out/leaf_cert.pem --key_file=net/tools/quic/certs/out/leaf_cert.pkcs8 --quic_in_memory_cache_dir=/home/asrivas2/quic-data/www.picsite10.com
[0113/232502:FATAL:quic_in_memory_cache.cc(175)] Response for 'www.picsite10.com/new_img_with_header.png' already exists!
#0 0x0000004ec48e base::debug::StackTrace::StackTrace()
#1 0x000000424d8f logging::LogMessage::~LogMessage()
#2 0x0000005df522 net::tools::QuicInMemoryCache::AddResponseImpl()
#3 0x0000005df26d net::tools::QuicInMemoryCache::AddResponse()
#4 0x0000005e000b net::tools::QuicInMemoryCache::InitializeFromDirectory()

how to get remove this error message? The png file mentioned in the error messsage here is on of the images that is used in the html webpage and kept in the 
same directory with the index.html.

You have mentioned appending a pre-header to the image file, I do not know how?


Regards,
Amit Srivastava

Wesley Davison

unread,
Jan 14, 2016, 9:34:38 AM1/14/16
to proto-quic
Amit, three information to help you:
  • in order to the QUIC toy server make a cache of the content to be served, it reads all the files inside "--quic_in_memory_cache_dir" folder. To do that, it tries to find some specific flags at the beginning of the file, which I call them as "pre-header". This pre-header, written as plain text, includes some flags that the toy server parses while loading the files. The flag related to the name of the file is the "X-Original-Url". An basic example of utilization is 
which informs the full path of that object inside the cache hierarchy;
  • the message "Response for 'www.picsite10.com/new_img_with_header.png' already exists! " is related to a repeated value of the  "X-Original-Url" flag. In other words, the server is finding the same value then parsing a new file. Probably, you have two different files with the same value of X-Original-Url flag;
  • To append this "pre-header", open the terminal and edit (using VIm, Emacs, or other program) the files you wish to be loaded by the server, adding flag and its value at the beginning of the file. As an example of doing this with an html file:

<!DOCTYPE html>
<!--

You can do the same with a png file. Just modify the index.html for the name of the object your html is trying to load.

Sorry for the long email, but I did not find other way to explain this.

I hope you get this thing solved with all this information

Amit Srivastava

unread,
Jan 15, 2016, 3:46:55 PM1/15/16
to proto...@chromium.org
Hi Wesley,

Thank you for replying back. I will try this out.
The email was not long at all and cleared my doubts.

Amit

Mamoun Mansour

unread,
Feb 24, 2016, 3:40:33 PM2/24/16
to proto...@chromium.org, daviso...@gmail.com
Dear Davison,

I need some clarification for the transfer other data. i have a new html page then i must insert the pre-header at the beginning of the file , then the question if previous is wright, is there any modification in the command of the server and client when running ?

Thanks for your help

Wesley Davison

unread,
Feb 25, 2016, 11:49:43 AM2/25/16
to Mamoun Mansour, proto-quic
Hi, Mamoun,

i must insert the pre-header at the beginning of the file

Yes, but pay attention to the X-Original-Url field. As I told before, this value must be unique for each file cached by the server.

is there any modification in the command of the server and client when running ?
 
So, if you just deleted the previous html and saved a new one, using the same pre-header, you can use the same command.

Please, tell me if you do not get it, ok?

BR

Wesley Davison

unread,
Mar 2, 2016, 7:00:02 AM3/2/16
to Mamoun Mansour, proto-quic
Hi, Mamoun,

if I understood right, you inserted the "X-Original-Url: https://www.example.org" AND the "X-Original-Url: https://www.example.org/th.jpg" in the same file (index.html). If you did this, I did not explained right. Let me try to do it again:
  • each file loaded by the QUIC server must have one, and just one, "X-Original-Url" field;
  • the QUIC server must load unique values, i.e., the values of "X-Original-Url:" must be unique among the loaded files.
So, try to do this:
  1. X-Original-Url: https://www.example.org/index.html
    <!doctype html>
    <html>
    <head>
        <title>Example Domain</title>
        <meta charset="utf-8" />.
    <body>
    <div>
        <h1>Example Domain</h1>
        <p>This domain is established to be used for illustrative examples in documents. You may use this
        domain in examples without prior coordination or asking for permission.</p>
        <p><a href="http://www.iana.org/domains/example">More information...</a></p>
    </div>
    </body>
    </html>
  2. Open  th.jpg file with a text editor (like VIm, Emacs, Nano, Gedit, ...) and add to the beginning of the file: 
    <binary data of the image>
  3. Load with the following command:
    google-chrome   --user-data-dir=/tmp/chrome-profile   --no-proxy-server   --enable-quic   --origin-to-force-quic-on=www.example.org:443   --host-resolver-rules='MAP www.example.org:443 localhost:6121'   https://www.example.org/index.html
I guess that this will solve your problems! Don't be shy to make a new contact if this does not help you. 

BR,
Wesley

On Wed, Mar 2, 2016 at 8:36 AM, Mamoun Mansour <mamo...@gmail.com> wrote:
Thanks Wesley for your kind help, please let me explain what I did again, 

I did all the QUIC setup steps mentioned in this URL:

Now, after getting the index.html file, I added  X-Original-Url field for the image file (th.jpg) I need to include in my index.html file, as shown below:

X-Original-Url: https://www.example.org/

<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
.
.
<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <p><a href="http://www.iana.org/domains/example">More information...</a></p>
<img src="th.jpg">
</div>
</body>
</html>

However, when  I open chrome  using the command below, I still do not see the image  inside index.html file. Did I miss anything? please note that I saved the image file in the same folder  where the index.html file is saved ( which s the www.example.org).

Here is the command I used to open the html page:

google-chrome   --user-data-dir=/tmp/chrome-profile   --no-proxy-server   --enable-quic   --origin-to-force-quic-on=www.example.org:443   --host-resolver-rules='MAP www.example.org:443 localhost:6121'   https://www.example.org



Wesley Davison

unread,
Mar 7, 2016, 7:03:09 AM3/7/16
to Mamoun Mansour, proto-quic
In the past, I achieved this task opening jpg and svg files using VIm. I do not better ideas to suggest you. Try to check if you left some whitespace or similar stuff that could damage the codification.

On Fri, Mar 4, 2016 at 11:01 AM, Mamoun Mansour <mamo...@gmail.com> wrote:

Thanks for your email,

I tried the steps you have mentioned, but the image file become corrupted whenever I inserted any text into it (before the binary data of the image), I tried using several editors like gedit, emac., vi, etc.

 

Also, do I need to do that for any file (video file for example)?

 

Thanks


Stefan Toth

unread,
Jun 16, 2016, 10:35:45 AM6/16/16
to QUIC Prototype Protocol Discussion group, mamo...@gmail.com
Was anybody successful in pulling through a larger image file using the sample client and server? Editing the .jpg to add X-Original-Url as recommended corrupts the file as noted by some folks. 

I do see the image file is in fact stored in the cache - just not sure how can I make the server to return it.
[0615/135613:VERBOSE1:quic_in_memory_cache.cc(299)] Add response with key testimage.jpg

Ryan Hamilton

unread,
Jun 16, 2016, 12:47:44 PM6/16/16
to proto...@chromium.org, Mamoun Mansour
It works for me. You just need to find and editor that does not corrupt the file. For example, it worked fine for me with emacs. I downloaded a file via the instructions:

% cp cheese-018.jpg cheese-018.jpg.bak
% emacs --no-init-file -nw cheese-018.jpg
% diff -du -a cheese-018.jpg.bak cheese-018.jpg
--- cheese-018.jpg.bak 2016-06-16 09:46:50.301594059 -0700
+++ cheese-018.jpg 2016-06-16 09:47:16.553656731 -0700
@@ -2,6 +2,7 @@
 Date: Thu, 16 Jun 2016 16:46:41 GMT
 Content-Type: image/jpeg
 Content-Length: 10594061
 Connection: keep-alive
 Set-Cookie: __cfduid=d7fdf33545c3a1c23d746ff4edba071291466095601; expires=Fri, 16-Jun-17 16:46:41 GMT; path=/; domain=.kingofwallpapers.com; HttpOnly
 Last-Modified: Fri, 22 Apr 2016 08:09:26 GMT

Notice, there are no changes to the body of the file.


Message has been deleted
Message has been deleted

Sreeja Mohan

unread,
Apr 24, 2017, 9:32:23 PM4/24/17
to QUIC Prototype Protocol Discussion group, daviso...@gmail.com
Hi Wesley,
                 I modified the png files with the X-Original-Url header. But, still when I load the main webpage, the embedded png objects show up as 404. Is there something else that I need to change?
Also, could you please elaborate on this step... "Just modify the index.html for the name of the object your html is trying to load."

Thanks,
Sreeja

Sreeja Mohan

unread,
May 8, 2017, 1:10:01 PM5/8/17
to QUIC Prototype Protocol Discussion group
Hi Amit,
             Were you able to load a webpage with embedded objects using quic toy client and server? Any help is appreciated..

Thanks,
Sreeja

Sreeja Mohan

unread,
May 8, 2017, 1:56:37 PM5/8/17
to QUIC Prototype Protocol Discussion group
Hi,
    If possible could you please let us know the steps that you followed for fetching embedded objects from local using quic toy client and server?

Thanks,
Sreeja
Reply all
Reply to author
Forward
0 new messages