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

websocket-frame-text error #48

Closed
shjanken opened this issue May 23, 2017 · 1 comment
Closed

websocket-frame-text error #48

shjanken opened this issue May 23, 2017 · 1 comment

Comments

@shjanken
Copy link

first, sorry for my poor English.

I write a websocket server in emacs with your awesome project.
the code is

(require 'websocket)
(eval-when-compile (require 'cl))

;;; the status of websocket-client closed
(setq ws-closed nil)

(let ((server-conn (websocket-server
		    9988
		    :Host "0.0.0.0"
		    :on-message (lambda (ws frame)
				  (message "Server received a messge")
				  (websocket-send-text
				   ws (websocket-frame-text frame)))
		    :on-open (lambda (_ws) (message "client connected open"))
		    :on-close (lambda (_ws) (setq ws-closed t))))))

and i have a client use javascript

var ws = new WebSocket('ws://localhost:9988')

ws.onopen = function() {
  ws.send("{type: 'identified', symbol: 'web'}")
};

ws.onmessage = function(event){
  console.log(event.data);
}

while(true) {
  ws.send()
}

but i received this message:

Error (websocket): in callback `on-message': Symbol's function definition is void: websocket-frame-text

please help me. Thank you very much!

@shjanken
Copy link
Author

shjanken commented May 24, 2017

sorry, i think i use the wrong version.
now i install it from melpa. Everything is correct

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

1 participant