Chat in AJAX

G

Gandalf

I wrote a chat width AJAX.
In my home wampserver apache it works just fine.

The problem starts when I trying to upload the chat in to my real
server. The chat prints error 403 in places which it should print the
http request. Like I don't have permissions in these pages.

there two things I should mark
1.I did let permissions to write and execute (chmod) my chat files.
2. My home server php version is 5.3 and my distant server php version
is 4.3 .

That is my home server link which works
http://85.250.226.88/chat/

That is my distant server link with the problem
http://kaze.co.il/chat_index.php

Most of the page is in hebrew.
The problem starts usually when trying to create a privet conversation
width one of the other users.

Thanks for everyone
 
L

-Lost

Gandalf said:
I wrote a chat width AJAX.
In my home wampserver apache it works just fine.

Then you need to specify what is different between your home and remote
servers.

(Not below, I mean figure all differences out yourself and work through
them.)
The problem starts when I trying to upload the chat in to my real
server. The chat prints error 403 in places which it should print the
http request. Like I don't have permissions in these pages.

That is specifically a server error. Which means Apache says you do not
have access to those pages (that are being requested).
there two things I should mark
1.I did let permissions to write and execute (chmod) my chat files.
2. My home server php version is 5.3 and my distant server php version
is 4.3 .

Neither of which is a JavaScript problem, but instead a file permissions
and PHP problem.
That is my home server link which works
http://85.250.226.88/chat/

That is my distant server link with the problem
http://kaze.co.il/chat_index.php

I attempted to see if there were any JavaScript errors. Yet you have
requests firing every 200ms or so. This made me shut the page
immediately. If there is truly a JavaScript problem, make the refresh
rate significantly lower, kind of like a debug mode and all requests
fire every five to ten seconds.
Most of the page is in hebrew.
The problem starts usually when trying to create a privet conversation
width one of the other users.

I do not speak Hebrew, nor understand it well enough to understand how
to initiate a private conversation.

I did however, create a nickname, join a chat "room" and then noticed
nothing I typed in got sent to the server.

I would have watched the requests that were made as well, but like I
said, firing them five to six times per second made it hard for me to
follow.
 
R

rf

I wrote a chat width AJAX.

Crikey, re-write it will you mate!

After -Lost made a response to your post I dived in for a look.

I let it run for exactly 20 seconds. During that time it used up 100KB of my
bandwidth. That is 5K of data per second. Outrageous.

I pay many dollars per month for my bandwidth, and my cap is 1GB per month.
Over that I pay twenty cents per megabyte.

<does sums> If I were to have your page simply sitting on my browser for
just 10 minutes your page would use up my bandwidth allocation for the
entire day.

And that is just me. What about your end. Lets say you have 10 people
online. That is 50K per second out of your bandwidth. 175MB per hour. Four
and a quarter gigabytes per day. 123 gigabytes per month. I hope you have an
"unlimited" hosting plan :)
 
G

Gandalf

Crikey, re-write it will you mate!

After -Lost made a response to your post I dived in for a look.

I let it run for exactly 20 seconds. During that time it used up 100KB of my
bandwidth. That is 5K of data per second. Outrageous.

I pay many dollars per month for my bandwidth, and my cap is 1GB per month.
Over that I pay twenty cents per megabyte.

<does sums> If I were to have your page simply sitting on my browser for
just 10 minutes your page would use up my bandwidth allocation for the
entire day.

And that is just me. What about your end. Lets say you have 10 people
online. That is 50K per second out of your bandwidth. 175MB per hour. Four
and a quarter gigabytes per day. 123 gigabytes per month. I hope you have an
"unlimited" hosting plan :)

Where do you live, mate?
I never heard of it.
In Israel it doesn't work like that at all.
Until this day I never thought anyone pays for bandwidth. Otherwise I
would owe my Internet company milions of dolars :) (my emule works
most of the day ).
 
D

Darko

Where do you live, mate?
I never heard of it.
In Israel it doesn't work like that at all.
Until this day I never thought anyone pays for bandwidth. Otherwise I
would owe my Internet company milions of dolars :) (my emule works
most of the day ).

Richard is right. If you plan to make something useful, that doesn't
just squander one's bandwidth (maybe in Israel it's not like that, but
in פלשתינה it might be ;-) ), you shouldconsider making some kind of
connection-based protocol. For example, I am right now in the middle
of a project that serves similar purpose - I am making as part of the
site I am on a module that serves the purpose of "live" betting - the
page should be dynamically updated as soon as quotas or conditions for
bets change in the database. So I made a daemon (am making, as a
matter of fact) sitting on the server that keeps connections from Ajax
on the clients, and gives them information just in the moment when
something changes. You could make something like that too - broadcast
messages only when someone says something. Of course, you can't rely
on the Apache server, since it usually has some kind of time limit for
one request, so you have to write your own server, but that's pretty
trivial, you can even write it in PHP, if you're not familiar with c/c+
+/Java, although I would recommend C++. Of course, all of this if you
want to spend more time for this and you want to make quality chat. If
you need support for this, you can ask here or at comp.lang.c++ or
comp.lang.c or comp.unix.programming...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,979
Messages
2,570,185
Members
46,725
Latest member
LeonidaTul

Latest Threads

Top