Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to connect socket server using angular 6 #80

Open
bhaveshvavdiya opened this issue Jan 13, 2019 · 2 comments
Open

Not able to connect socket server using angular 6 #80

bhaveshvavdiya opened this issue Jan 13, 2019 · 2 comments

Comments

@bhaveshvavdiya
Copy link

I am using erl9.3 and angular 6 with ([email protected])

When I call

this.socket = io.connect('localhost:3000');

I get below data in erlang server using below code

	case gen_tcp:recv(Sock, 0) of 
		{ok, Data} ->
			io:format("recv!~n"),
			case handle_request(Sock, Data) of
				ok ->
					io:format("~p",[Data]),
					sock_loop(Sock);
				exit ->
					exit(normal)
			end;
		{error, Why} ->
			error(Why)
	end.

GET / HTTP/1.1\r\n
Host: localhost:4001\r\n
Connection: Upgrade\r\n
Pragma: no-cache\r\n
Cache-Control: no-cache\r\n
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36\r\n
Upgrade: websocket\r\n
Origin: http://localhost:4200\r\nSec-WebSocket-Version: 13\r\n
Accept-Encoding: gzip, deflate, br\r\n
Accept-Language: en-US,en;q=0.9\r\n
Cookie: ga=GA1.1.1506806518.1546498546; io=uJqwysezr_yBH-aAAAj\r\n
Sec-WebSocket-Key: vwbgM9H5sh0z1irkN8Ugyg==\r\n
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n

After that nothing happens. Even not fire 'connect' callback at Angular site.

@ferd
Copy link
Collaborator

ferd commented Jan 13, 2019

This repository is unmaintained and is not compatible with any recent socket.io version, only very old ones before the thing had turned to a kind of framework.

@bhaveshvavdiya
Copy link
Author

I read the document at below link & also tried socket.io 0.6, 0.7 & 0.9
http://marcelog.github.io/articles/erlang_websocket_server_cowboy_tutorial.html

Still, it is not working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants