Page 1 of 1

Internet browser problems

Posted: Sat Oct 11, 2003 1:12 am
by Dreglor
Well I working on a web browser with out using the built-in version that uses internet explorer
Because internet explorer is crap first of all and it does not run hardly on my computer (don’t know why but just is)

Any way I have gotten pretty far in and haven't had many problems but have 2 major problems that I *will* need help on

1. My main problem, getting text and images (my main goal at the moment) on the screen by any means necessary (hard that is sounds...)

2. This one I currently working on in a separate side project console based, I will move into the G.U.I. when I get it done. anyways the ways of transferring data back and forth between the server and the browser or client at the moment I been looking at the web server that came with Pure-Basic and I got a working example (using the atomic web server), but the problem is that when I try it with other servers (like "www.mirosoft.com" or "www.google.com") it times out and then gives me a small web page say that it timed out. So I need to know what it needs to send after it sends the “GET" command

I have a quick third problem but it not as big as the other ones I have up above, I trying to get a way to separate addresses for the server name and the exact file I need to "GET" here’s an
Example: "http://www.purebasic.com/download/PureB ... e_3.80.zip" (I bit long sorry :? )
I need that link to be this
"www.purebasic.com" for the server and this "download/PureBasic_Update_3.80.zip" (notice I removed the "/" before "download" and the http:// because i found that http:// is not used in the domain names)
So you know what I saying here

I been trying to get it but it does seam to be working to well :?

Thanks in advance :)

And B.T.W. heh got MS office now I have perfect spelling and grammar skills :P

Posted: Sat Oct 11, 2003 2:10 am
by Karbon
Now that's a big project!

You need to start reading RFCs...

Start here at the HTTP RFC : http://www.w3.org/Protocols/rfc2616/rfc2616.html

Make some coffee- most RFCs are a long and boring read :-)

Posted: Sat Oct 11, 2003 4:06 am
by Dreglor
Make some coffee- most RFCs are a long and boring read
your proabaly right about this...
just the contents are huge
well i better get started i see you in thridy-some hours :roll:

Re: Internet browser problems

Posted: Sat Oct 11, 2003 4:51 am
by ricardo
Hi,

Its not hard to make the HTTP header, but in some cases it fails.
So i get this procedure in this forums and it works fasta and nice for me:

Code: Select all

Procedure.s OpenURL(Url.s, OpenType.b) 
  isLoop.b=1 
  INET_RELOAD.l=$80000000 
  hInet.l=0: hURL.l=0: Bytes.l=0 
  Buffer.s=Space(2048) 
  
  hInet = InternetOpen_("PB@INET", OpenType, #NULL, #NULL, 0) 
  hURL = InternetOpenUrl_(hInet, Url, #NULL, 0, INET_RELOAD, 0) 
  
  Repeat 
    
    Delay(1)
    InternetReadFile_(hURL, @Buffer, Len(Buffer), @Bytes) 
    If Bytes = 0 
      isLoop=0 
    Else 
      res = res + Left(Buffer, Bytes) 
    EndIf 
  Until isLoop=0 
  InternetCloseHandle_(hURL) 
  InternetCloseHandle_(hInet) 
  ProcedureReturn res 
EndProcedure
To use it just call it:

Code: Select all

 Url$ = "http://www.mysite.com"
 Html$ =  OpenURL(Url$,1) ;<< Always the second parameter is 1
Then in the Html$ string you will have the html code.

If the file is bigger, then you should use memory because the string has a limited size.

Posted: Sat Oct 11, 2003 5:41 am
by Dreglor
it useing a win api right?
well, from what i see in the code it grabs a file right off.
now would it be faster if windows api calls doing most of the work or would i be faster if i did the codeing which does not seam much work once i get the "know-how" to do (which i still reading...)
i would also would like to have room for modifacation for certain things like, intergated download accelrator or somthing
but this is a big project and winapi may help me here and there but i don't want to use it for 100% of my project

Posted: Sun Oct 12, 2003 12:51 am
by ricardo
Dreglor wrote:it useing a win api right?
well, from what i see in the code it grabs a file right off.
now would it be faster if windows api calls doing most of the work or would i be faster if i did the codeing which does not seam much work once i get the "know-how" to do (which i still reading...)
i would also would like to have room for modifacation for certain things like, intergated download accelrator or somthing
but this is a big project and winapi may help me here and there but i don't want to use it for 100% of my project
It will be faster (i think) if you code your own, BUT be aware that Microsoft servers dont accept the headers that apache accepts... i dont remember, but in many cases i found some problems so i had to go to microsoft papers and... this procedure (i dont develope it, i just pick it from this forum) does the job without problems and reasonable fast.

I use it for a project that i get 20,000 pages in one night and parse it, and dont find any trouble.

When i was using my own GET header, i find some kind of trouble every 50 pages in average!!!

If you want to be an expert in the area, do your own procedure, otherwise use this one :wink:

Posted: Sun Oct 12, 2003 1:31 am
by Dreglor
well i found my self an easyer way on how to construct headers and other things

an program (trial ware, oh hurt me...) but it tracks http packets :)
now all i have to do is read the headers and i proably would have it somewhat working

btw i still need some way of haveing text and pictures in the gui :roll:
i'm thinking that api's will have there role in that problem

Re: Internet browser problems

Posted: Mon Oct 13, 2003 2:36 pm
by TerryHough
Dreglor wrote:... internet explorer is crap first of all and it does not run hardly on my computer (don’t know why but just is)
:lol: ROFL... if I didn't know better, I would think I was on another forum
where they spend half their time bashing IE and touting the wonderful
other browsers ad nauseum.

:twisted: A simple solution. If Internet Exployer is "crap" and doesn't
hardly run on your computer, try removing it totally. After all, Windows
will work perfectly once it doesn't have to contend with IE's problems.

-----------

But seriously, while reading the RFC's for "thridy-some" hours and
coding your own browser could be intellectually challenging and
rewarding, a couple of hours reinstalling Windows and thoroughly
updating it with all the patches and the latest IE version would be more
productive IMHO. Apply a few of the well publicized "tweaks" and
your entire system will progress way beyond hardly running to a
much more satisfying, smooth running machine.

HINT: don't overlook the obvious -- a sufficient amount of RAM installed.
Every Windows version runs much better with twice the MS minimum
RAM specification.

------------

Regards,
Terry

Posted: Mon Oct 13, 2003 8:13 pm
by Dreglor
HINT: don't overlook the obvious -- a sufficient amount of RAM installed.
Every Windows version runs much better with twice the MS minimum
RAM specification.
i yeah windows is a real memory sucker

well i did get my browser project to be able to send a for a file and get the file
now i just have to have some way of firguring out were teh end of the file is because it *always* in chunks and most of the time the header does not tell me how long it is.