Вообщем какой примерно код, что бы получить сообщение с чата на сайте, в чат на сервер, Веб сервер работает на NODEJS
sample
Код:
#include <amxmodx>
#include <sockets_hz>
new listening_socket
public plugin_init() {
new error //you're the error
register_plugin("demo", "0.1", "hackziner")
listening_socket = socket_listen("127.0.0.1",8081,SOCKET_TCP,error)
socket_unblock(listening_socket)
server_print("LISTENNING ANY IP ON PORT %d",8081)
set_task(1.0,"auto_accept_reply",0,"",0,"b")
}
public plugin_end ()
{
socket_close(listening_socket) //very very important !!
}
public auto_accept_reply() {
new this_chaussette;
if((this_chaussette=socket_accept(listening_socket))<0)
{
server_print("No pending connection")
}
else
{
new cmd[1024]
server_print("Accept/send/close")
format(cmd,1024,"Something to send")
socket_send(this_chaussette,cmd,1024)
socket_close(this_chaussette)
}
}