Git Product home page Git Product logo

Comments (11)

nickdesaulniers avatar nickdesaulniers commented on June 3, 2024

nvm!

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

:P

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

Is this related to https://bugzilla.mozilla.org/show_bug.cgi?id=878972 perchance?

from paramikojs.

nickdesaulniers avatar nickdesaulniers commented on June 3, 2024

Yes. I'm trying to use paramikojs with TCPSockets, part of the new Raw Sockets API.

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

Cool, dude. Curious: how does one use/test out TCPSockets - is it in FF and/or FF OS somewhere?

from paramikojs.

nickdesaulniers avatar nickdesaulniers commented on June 3, 2024

FF OS privileged packaged apps
See what I did for IRC.

from paramikojs.

nickdesaulniers avatar nickdesaulniers commented on June 3, 2024

So I'm currently trying to understand the relationship between observer and transports. It looks like I might end up needing some code from FireSSH, too. Your code in FireSSH looks really similar to our implementation of the current spec. Would you be interested in working with me on possibly reworking some of the existing code to reuse mozTCPSocket?

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

Sure man! I'd love to help :) Lemme know whatchya need.

Seems like one of things I have to do to start is make some updates to paramikojs - this version of the library is a fork of the original library ( https://github.com/paramiko/paramiko/commits/master?page=11 ) from when it was version 1.7.7.1. I'll have to go through all the latest commits and update this library accordingly.

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

@nickdesaulniers I finally had some time to checkout mozTCPSocket - does it work on Desktop Firefox? I'm trying in Web Console and not getting very far.

Email me, if you got time: [email protected]

Seems like mozTCPSocket would simplify FireSSH/FireFTP code a lot - if I can see how to get it work!

I tried the following in desktop Web Console, no dice:

host = 'http://google.com:80';
perm = Components.classes["@mozilla.org/permissionmanager;1"]
                 .createInstance(Components.interfaces.nsIPermissionManager);
ios = Components.classes["@mozilla.org/network/io-service;1"]
                .getService(Components.interfaces.nsIIOService);
uri = ios.newURI(host, null, null);
perm.add(uri, 'tcp-socket', 1);

var socket = navigator.mozTCPSocket.open('google.com', 80);
socket.ondata = function (event) {
  if (typeof event.data === 'string') {
    console.log('Get a string: ' + event.data);
  } else {
    console.log('Get a Uint8Array');
  }
}

from paramikojs.

nickdesaulniers avatar nickdesaulniers commented on June 3, 2024

Bring up the error console in firefox by hitting control-shift-J. Paste the code into the "Code" box and click the "evaluate" button.

command+shift+J in OSX opens the "browser console" in Nightly, which has replaced the ancient error console.

from paramikojs.

mimecuvalo avatar mimecuvalo commented on June 3, 2024

I misunderstood - I had thought that giving permission to a URL would mean I could open a socket to the url. I see now that adding the permission let's me create a socket while on that domain.

I want to run it from chrome://firessh/content/firessh.xul which is where I would like to use the TCPsocket. Does this only work on regular web pages? I tried running this within my extension but nothing happens...is there something else I'm missing?

from paramikojs.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.