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

connect to a socket REPL #12

Open
velkyel opened this issue Dec 1, 2016 · 7 comments
Open

connect to a socket REPL #12

velkyel opened this issue Dec 1, 2016 · 7 comments

Comments

@velkyel
Copy link

velkyel commented Dec 1, 2016

is it possible to add connect to a socket REPL feature like in inf-clojure, please?
There is possible to define inf-clojure-program like cons pair ("localhost" . 5555).

@redguardtoo
Copy link
Owner

what's socket REPL?

@velkyel
Copy link
Author

velkyel commented Dec 2, 2016

do you know emacs commint file?

@redguardtoo
Copy link
Owner

No. Do you mean comint? What's the advantage to start a socket REPL?

@velkyel
Copy link
Author

velkyel commented Dec 2, 2016

comint, sorry. "socket REPL" is now known name?

@velkyel
Copy link
Author

velkyel commented Dec 2, 2016

Advantage? Running game with embedded js vm. Toying, scripting, debugging.

@redguardtoo
Copy link
Owner

How can I do that in NodeJS? Can you show me some prototype?

@velkyel
Copy link
Author

velkyel commented Dec 13, 2016

like this:

var net = require('net');

var server = net.createServer(function(socket) {
    socket.setEncoding('utf8');
    socket.on('data', function(data) {
        var res = eval(data);
        socket.end(res.toString());
    });
});

server.listen(8000);

and run-js localhost:8000 in emacs.

I don't know nodejs too much -- actually I'd like to use js-comint mode to connect to my running app with embedded duktape (duktape.org) vm. This app listen and eval incoming data like example server.

@velkyel velkyel closed this as completed Dec 13, 2016
@velkyel velkyel reopened this Dec 13, 2016
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