We _are_ trying to help you.

First, learn english (this includes correct spelling - makes it a lot easier for people to understand what you're writing).

Then, you should probably spend some time learning to choose proper search keywords - as Thomas said, there's a LOT of information out there - and even sample source code.

Happy easter.
Posted on 2003-04-16 10:01:54 by f0dder
I did, but found nowere code for comunivate with proxy.
The theror I know, as you can the in my code example.
But in praxis I need help. :cool:

Greet FF
Posted on 2003-04-16 10:07:10 by Forginforcer
I think you should follow Thomas advice,
in case you missed it:

I recommend you to start programming something easier first and try again later when you have enough experience to write such a program.


:alright:
Posted on 2003-04-16 14:06:05 by Ray
I know something about socket programmming.
Thats a good aim for the next.
But when I havn't any tuts about that or advice, I will learn that never.

Please help me a little more. From where you have learn that ?

Regard FF.:stupid:

P.S. Say me at least, whether its possible to send te mail with the HTTP-prot of the proxy sever.
:confused:
Posted on 2003-04-16 14:17:28 by Forginforcer
P.S. Say me at least, whether its possible to send te mail with the HTTP-prot of the proxy sever.
:confused:

Etherlord and EvilHomer2k have already explained this to you.

Thomas
Posted on 2003-04-16 14:33:38 by Thomas
I will read through my post agein :confused:

Bye !
Posted on 2003-04-16 14:49:47 by Forginforcer
here a little change, but it doesn't work:

.data
proxyserver DB "192.168.0.1"
port DW 808
ultrastring DB 'Get http://****.de/index.html HTTP/1.0',0

.data?
sock dd ?
.code
INVOKE WSAStartup, 200h, ADDR wsadata
INVOKE socket, AF_INET, SOCK_STREAM, 0
.IF EAX != INVALID_SOCKET
INVOKE MessageBox, NULL, ADDR btempl, ADDR btempl, NULL
.ENDIF
MOV sock, EAX
MOV sin.sin_family, AF_INET
INVOKE htons, port
MOV sin.sin_port, ax
INVOKE inet_addr, ADDR proxyserver
LEA EAX, sin
INVOKE connect, sock, ADDR sin, sizeof sin
.IF EAX != SOCKET_ERROR
INVOKE MessageBox, NULL, NULL, NULL, NULL
INVOKE send, socket, ultrastring, 29, 0
.ENDIF

As you alredy know (for about 1 week) I want to kommunicate with my Proxy. But thise code doesnt work. Why ?
Did I make some hardcore-mistakes ?

Deep regards FF
Posted on 2003-04-17 07:18:47 by Forginforcer
Besides what everybody else has told you ... to search and read yourself ... you need to tell us what is happening. We don't have access to your proxy, so we can't tell you anything when you say
but it doesn't work


You need to at least find why/where it isn't working then ask specific questions.

Also if you are going to communicate (looked how I spelled that compared to yours) with your proxy using HTTP, you need to read the HTTP RFC.
Posted on 2003-04-17 07:28:10 by gorshing
Hi, your are totalty right ! - I forgot to say, whats wrong !

I cant connect.

If you want to try my Proxy the Adress is:

MittelalterStore.sytes.net

THX !

P.S. I have read the RFSs.
I hope that I articulated me right !
Posted on 2003-04-17 07:34:18 by Forginforcer
It is RFC not RFS

Also if you did read them, you have forgot how to end your send command. I am not going to tell you because I do not believe that you have read them. Hint there are two characters at the end of your string that are missing. That (of course) has nothing to do with you not being able to connect, but it will cause you problems later on.

I do not have a compiler/assembler on my computer where I am at. So I'll check that out later.
Posted on 2003-04-17 07:39:20 by gorshing
I meand RFCs sorry !

In my Programm I have 0 append at the proy's IP-string.

But it doesnt work.

the error occurs already at the socket cretion.

What now ? :confused:
Posted on 2003-04-17 07:43:59 by Forginforcer
Some tips:
- The windows API usually uses null terminated strings but the HTTP protocol doesn't have 'strings' or something. It just has a sequence of bytes (plain text data for the request), without null terminators. So you don't need the 0 byte at the end as long as you give the right size as send's parameter (which is 46 for "GET http://MittelalterStore.sytes.net HTTP/1.0", not 29 like you wrote).
- Hardcoding a string's size is bad. Instead, define a constant for the length (preferably automatically calculated), or do add a 0 byte to the end and use lstrlen to determine the length of the string before sending it. Note that in the latter case, the 0 byte is *only* necessary for lstrlen, you are *not* actually sending it (just the characters). The former method saves a byte and a lstrlen call and is quite easy to use, my networking tutorial has an example of it (chapter 6).
- There's more to a HTTP request than just the GET line, you still need the headers (some of which are compulsary for most servers like host), and the request terminator (blank line)
- Read chapter 6 of my tutorial!. A nearly complete example of a HTTP request is explained in detail here.
- WSAStartup and send can fail too, don't forget error checking.

Thomas
Posted on 2003-04-17 12:29:21 by Thomas
Thomas, what about the cr and lf?
Posted on 2003-04-17 14:35:51 by gorshing
What's a coincidence !
I just wantet do write, that it isnt't required to write these 0s.
I'm just reading you tutorial ! - Pretty cool ! *hihihi*

P.S. I have for every error an error handle !
Posted on 2003-04-17 14:54:13 by Forginforcer

Thomas, what about the cr and lf?

Well forginforcer's request wasn't complete anyway so I left that out but my tutorial shows how to send a full request.

Originally posted by Forginforcer
What's a coincidence !
I just wantet do write, that it isnt't required to write these 0s.

Good you already know that :)

P.S. I have for every error an error handle !

Not in the code you posted so that's why I mentioned it.

Thomas
Posted on 2003-04-17 14:58:14 by Thomas
For a better overwiev purpose.
But in my full source I'm intercepting every error !

Thanks four your tip !
Posted on 2003-04-17 15:09:46 by Forginforcer

We _are_ trying to help you.

First, learn english (this includes correct spelling - makes it a lot easier for people to understand what you're writing).


well, not only that, but it will help understanding the documents and typing in search terms correctly (i can't remember who it was who did some furious searching, but spelled something incorrectly... always a problem for me, too - but that's why i like Google's 'did you mean' thing :grin: )
Posted on 2003-04-18 13:08:35 by jademtech
crlf = carriage return line field
cr = 13h
lf = 10h
Posted on 2003-04-18 23:41:44 by roticv
INVOKE WSAStartup, 200h, ADDR wsadata

200h means version 0.2
Posted on 2003-04-19 09:28:25 by Aaro
Geez, is thread for real? LOL
Posted on 2003-04-19 11:21:08 by iblis