« first day (1773 days earlier)      last day (3400 days later) » 

19:00
!!<3
@Cauterite I think I fixed the error but I don't think its working. I'm going to look for another solution
Hi all
@Y.kened Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
nvm got it
19:00
@Trasiva ew
@CapricaSix that's ok
@JanDvorak Your opinion has been noted.
@benlevywebdesign good luck; i need to sleep now, bye
@JanDvorak That didn't make much sense. Use the !!/help command to learn more.
19:01
it's 21.01
what's 21.01?
@AwalGarg The padding just means "no data", so if the decoder's not a retard it knows it's processing the last chunk
time
lol ok
in what zone?
19:02
CEST
UTC+1 I think ?
not sure
and you what time is it in your zone?
central european time = most of Europe, with one exception.
UTC+10, 05:03
lol you are in Mexico?
!!>(new Date()).getHours()
19:04
@JanDvorak "2015-08-24T19:04:01.645Z"
+10, not -10
i'm in Melbourne btw
@JanDvorak "TypeError: (intermediate value).getHour is not a function"
@JanDvorak "TypeError: (intermediate value).getHour is not a function"
gist.github.com/rlemon/20766c7fde298a26d3c3 node + websockets + http-proxy why the friggs is the upgrade event never sent?
@JanDvorak 15
19:05
Australia, senD me a Koala and a kangaroo PLEASE
!!s/coala/koala/
@Trasiva Australia, sent me a koala and a kangourou plz (source)
let me grab my shovel…
*send, *koala, *kangaroo, please
@JanDvorak That works too, haha.
19:06
@Kitler help me
you love me
help me
:D
sup
1 min ago, by rlemon
https://gist.github.com/rlemon/20766c7fde298a26d3c3 node + websockets + http-proxy why the friggs is the upgrade event never sent?
my node/io-foo is nonexistent
@JanDvorak edited
@Kitler :(
19:07
come to think of it, it's your fault!
@Kitler Loves @rlemon <3
what of it?
We send each other dickpics, problem?
Happy
4 you
you jelly of our bromance?
19:08
are you married?
sounds like broverkill
I'm married to the job
Am jealous that's all
need lover in this moment :D
log off and go mingle
Which one of these is "gif"
The last one?
19:11
last one
try all of them?
last one records
Records a video
If you want to save screen ? last one
Ah, I fixed it to save as a gif
19:12
there's bound to be an extension that isn't in french :P
I don't know why it's in french
This computer thinks I'm in france. I've already changed the locale
@Cereal Woo, ShareX!
perhaps, but french is still easier to read than swahili
Half the stuff is still french
where you found that?
19:13
@Cereal Do you stink of cheese and snootiness?
@BenFortune shareX has drastically improved my life
Been using it for a couple years now
@Trasiva I love cheese, and the coffee there is the best coffee I've ever had
I miss espresso
Like real espresso
I love mojito's
That's why it thinks you're French.
19:14
^ sharex in a nutshell
@Cereal Wow, 30fps or nothing
@BenFortune THE SETTINGS ARE IN FRENCH, I"m GETTING THERE
open up google translate's app with the camera
Hey got it in english
Feature bloat in a nutshell...
How do you copy a photo here?
19:16
by repwhoring
btw @Cereal the danger is now over. (I added a firewall rule to block those transcript pages and google searches as well)
thank you man.
@Mosho here?
@rlemon rubber duck it
repwhoring how?
@AwalGarg c
@Y.kened ask @jAndy
@Kitler "c"?
19:21
c = confirm
@jAndy how
ok thanks
welcome
@Lalaland your deletion extension doesn't record history btw. so edit to . before deletion makes your extension useless
how you put an image here?
19:22
@Kitler have, this is my super simple example
web and websockets from different ports
all I want
evening
I figured out what works!
<a href="" onclick="window.location.hash = '#printsql';">
<i class="material-icons modalrefresh">refresh</i>
</a>
you are apologizing too much. put in something like "why the fuck is this not working debug my code you bitches"
19:28
I am absolutely waiting for the page to be loaded. but I am still getting a null object/element. What more can I try..?
            $(window).load(function() {
                isLoaded = true;

                if (isLoaded && kitGroupID != 0) {
                    getPlayList(kitGroupID);
                }
            });
getting null here:                             var gridView = $find("<%= grid1.ClientID %>").get_masterTableView();
                            gridView.set_dataSource(eval(msg));
                            gridView.dataBind();
@AwalGarg Sorry, I like to make it transparent that I am Canadian
when trying to use get_masterTableView
is the content dynamically loaded?
I bet it is
@BenjaminGruenbaum ya
I have tried to proxy websockets only about 5 dozen times now
never had any luck :./
I wish I could get my hands on a working example, and not just snippets other people 'claim' to work
19:31
arghhhh Cannot read property 'set_dataSource' of null
@rlemon I get CORS errors with your code
because it is falling back to xhr polling, and I don't have the demo setup to send the headers
@JoJo your mess of indentation takes about half of my screen. the court won't mind if I send you to the farthest star inhabited by Java programmers
I thought it didn't fallback anymore?
@BenFortune the point is that the upgrade event isn't being sent.
no server.on('upgrade' is handled.
19:32
Ah
I know how to proxy the web requests, but then I'm using socket.io for a longpolling solution
:?
You're not allowing long-polling to your socket.io server though?
io.set('transports', ['websocket']);
Nvm, I get you
@AwalGarg No, no. You have to send him to the one inhabited by Cold Fusion as punishment.
That... that is too much for the crime he committed.
@BenFortune so it isn't sending the upgrade for you as well then right?
19:39
Not with your code no
@SomeGuy I've started using Phone to Chrome, it's pretty nice! Just hitting "Share" didn't quite work (it just opened Phone to Chrome, no link pasted), but besides that, basic and functional.
I mean, is there something I'm missing?
I'm so stumped.
Other than ws taking 3 arguments, I can't see anything either
but I'm not even getting the console.log in the server.on('upgrade', function() ..
19:42
lol the code I have got to work on has 70 script tags which all contain exactly 6 lines of document.writes each and they are wondering why none of them is working
@rlemon Wait, doesn't the upgrade request need to go to the WS server?
You're proxying it to the main server on 7000
err, that may be a typo from me making sure it is actually working without the proxy
nono that is right
The socket connection works when I change the first proxy from 7000 to 8000
what the fuck.
but how
how does it ever get to :7000 then?
socket.io still has a http server
You need to proxy all 3
19:45
:/
web, socket.io's http server and socket.io's ws server
how?
care to elaborate?
I want website (static data) coming from one node instance, websocket data coming from another. Don't care how it is all hooked up
Well, I changed the socket from 7000 to 8000 but didn't refresh the page, so the socket was still trying to connect
i want website pls
Just trying to think how to tie it together
19:47
I'm desperate for a simple demo of this working, which works for me. :P
sorry, let me rephrase.
URGENT HELP NEEDED PLS! ONLY SRS PPL> REST CAN SHUT UP!
6
user1596138
!important
what the actual fucking fuck in the world am I dealing with
@rlemon It's dumb, because you need to distinguish socket.io's polling connection from your normal web requests if they're on different servers
socket.io probably sends some sort of header though
just do it
Or not...
19:50
I'll buy you a beer
@BenjaminGruenbaum hey are you free?
ugh.. that was a bear.. telerik.com/forums/…
@AwalGarg sure, sup?
@BenjaminGruenbaum umm, this could be daunting. need some advice on a horrible mess. can open 1to1 room?
@AwalGarg sure
19:52
@rlemon It looks pretty stupid but it sorta works
var server = require('http').createServer(function(req, res) {
  console.log('web request');
  if(req.url.indexOf('/socket.io/') !== -1) {
      proxy.web(req, res, {
        target: 'http://127.0.0.1:8000'
      },function(e){
        log_error(e,req);
      });
  } else {
      proxy.web(req, res, {
        target: 'http://127.0.0.1:7000'
      },function(e){
        log_error(e,req);
      });
  }
})
but that is always proxy.web
@FlorianMargaine Have you ever tried Spacemacs?
does that actually utilize websockets or just long polling?
@rlemon The on('upgrade', ...) stuff is still there, that's just for the initial socket.io connection
Socket.io's initial connection is always polling, then it upgrades to ws if it can
@Zirak emacs in spaaaaaaaace
19:58
@BenFortune still not getting upgrade :/
@SomeKittens Zombies not included
wait
WHO PUT ZOMBIES ON MY SPACECRAFT
@BenFortune yea, it just starts spitting out connection refused. no upgrade event is sent.
long polling attempts
Works for me :/ The only code I've changed is in the createServer handler
20:06
wtf :/
did you change index.ejs at all?
Nope
Oh wait
I added polling to the transports
io.set('transports', ['websocket', 'polling']);
yea, so it is ever using the actual websockets?
because it looks like it is polling for you still
Like I said, it needs to poll for the initial connection
that isn't what it is doing tho
Then it upgrades to websockets, as you can see in the second screenshot
20:10
well this is what I get
exact same fucking code...
Private :c
try now
You added polling yeah?
yup
fuckity fuck fuck
why does this work for you and not for me
Windows
20:16
you're on windows?
Can't see it having any difference though.
What node version you on?
0.10.35
That might make a difference though, I'm on 0.12
Sec, gonna downgrade
unfortunately I'm stuck on 0.10 for the next little bit
@rlemon You certainly are showing the diversity of the word.
20:18
@Zirak haven't tried spacemacs, no, these emacs distributions don't attract me...
@FlorianMargaine How about Evil mode separately, or Viper mode?
0.10.35 works for me too
@SomeKittens my commit count has reduced, but it's quite fine
@BenFortune :( well now I'm sad
All I wanna fucking do is have my websockets served from a different server per client without forcing myself to result to long-polling fallback. :/ why is this so hard?
@Zirak I tried evil mode (viper is deprecated), but that was when I switched from vim, so I was biased and wanted to try without. I should give it another go.
20:21
@rlemon It's refusing, is it actually reaching the proxy server?
Nvm, web request logs
@BenFortune it gets socket.io.js
nothing else past that works
so the first polling request fails... therefore well.. I suppose websockets will never work for me
@rlemon Aren't you getting that from a CDN?
changed to /socket.io/socket.io.js
because you're forwarding those requests now
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
<script src="/socket.io/socket.io.js"></script>
<script>
io = io.connect('http://127.0.0.1');
io.emit('event', 'hello server');
</script>
</body>
</html>
index.ejs
if I connect directly to the socket.io port it works, so I know socket.io is working.
Still works ._.
Worked in a linux vm in docker too..
ugh.
20:26
@rlemon: open your packet sniffer and see what's going on exactly?
well if you would be so nice, I am uploading my project folder
see if that works
rlemon.ca/files/proxytest2.tar.gz
I'm running ws.js first, then webserver.js, then app.js
Thanks for the virus
yw
did you open rlemons-credit-card-info.txt.exe ??
now, that node_modules is for my os/cpu
so you'll need to probably re do that
Well, without npm installing I can repro
ohh, so my files fail for you as well?
20:29
Aye
\o/ progress! I'm not crazy!
Let me see what's different
@rlemon You are crazy, you're just not THAT crazy.
Fuck me
If I run my proxy on 8080 it fails
But works on any other
really :/
20:32
Actually no
it only works on 80
Adding a port to the browser url is throwing it off
it needs to be root for http-proxy upgrades to be sent?
are you fucking yanking my pole?
possibly
You could always proxy through nginx :p
I'm not that smart. the websocket port changes per user
so I'd need to have node still tell nginx where to proxy it too
yea, each user has a dedicated device running the websocket server which sits on the main server on port :xyz
okay, so node running on 8888 with sudo gives me ECONNREFUSED
but on :80 it works.
I'm so confused.
20:36
Might have found something
I am just learning JavaScript a bit more and testing on node.js :) What do you think of my code? What can be better? pastebin.com/eVwLbWaE
well, you don't have to repeat the name of every function,
Repeat?
If that's a constructor, you need to put functions on the prototype
this.dial = function(data) { instead of this.dial = function dial(data) {
20:38
Ah I see
@I'll-Be-Back what's the purpose?
this.prototype.dial = function(data) { ... }
FUCK YEA IT WORKS!
@I'll-Be-Back it only needs a name if it's self-referrential
congrats, bob
20:39
@BenFortune I owe you a beer.
@rlemon What did you do?
@BenFortune run it as root.
@SomeKittens Just learning. I am simulating phone call. How long it will ring, answered and then how long it will talk. That pretty much it.
and make sure the client points to the same fucking listen port :D
Root as in sudo or 80 root?
20:40
@Nick Why use use prototype when it can be done in a function like I did.
Hmm. It can be tricky to say "This is the best way to do X" when X doesn't really exist
I still want to know why the fuck it won't run on other ports
@I'll-Be-Back Because right now, every instance of that object that you create will copy/duplicate that exact same function. If you put it on the prototype, they all share the exact same one, creating a lot less bloat in memory
Prototyping is part of what javascript is known for
take advantage of it
Nice work Bobby Boucher (@rlemon).
@Nick Ah I see, I get your point now.
20:44
@BenFortune any port
has to be root tho
I'm running root on 8888 right now
@I'll-Be-Back it should be something like, Sim.prototype.dial = function(data) { ... }
@BenFortune and yes, root as in sudo node app
Yep, I am going to make some changes.
isn't JS supposed to have some proper syntax for defining classes now?
Why would that make a difference though?
20:45
@BenFortune :shrugs:
And what would be the windows alternative? Since mine still doesn't work :p
run node as administrator?
@Cauterite Yes, but it's not wholly supported yet; but you can use a transpiler
!!tell Cauterite mdn class
@Cauterite Classes
20:46
how convenient
@BenFortune wait.
now it is running without root
@BenFortune also, make sure you change the io.connect (index.ejs) when changing the port
I bet that is your problem
because that just connects on 127.0.0.1 for the demo I sent you
@rlemon Why? Isn't the whole point being able to connect to / and having the port forward?
@Nick Could you give me idea how it can be done? I want to remove switch block from my code and replace something something like outcome(this.data.outcome) which then go to that matching function or something. You get my idea?
20:48
oh wow, classes aren't even supported in firefox release builds yet?
Oh wait, I get you
;) kk
yea I think I had some stuff wrong, you corrected it, but then I had other stuff wrong
Yeah yeah haha
and I confused the fuck out of both of us
time to call it a day and play hearthstone
You were still doing io.connect('http://127.0.0.1');
Why the fuck didn't I catch that
20:49
@I'll-Be-Back : not entirely sure what you're trying to achieve with that description
because we're both numb nuts
@rlemon You play hearthstone? I bet you play as Jaina .
m59
m59
Anyone worked with country names in a database? Do you use the full name or 2 character abbreviation?
Should've been obvious after port 80 was working lmao
@m59 Both
@Trasiva still too early to choose. I got lvl20 Warrior and Hunter, working on Shaman right now.
only started playing on saturday
20:51
ISO country code, abbreviated name and full name
need to complete the basic deck before I choose who I really like playing with
m59
m59
I also need to do ?country=US, for which abbrev is slightly favorable to me.
So, abbrev the whole way is acceptable? (and just show full name in the UI)
@rlemon Ah, I kinda gave up on it. I have most the characters at least 10+, but the problem comes in that some people have just gone the P2W mode and made stupidly difficult decks to go up against.
@Cauterite I could have many outcome such as No Answer, Answer, VoiceMail, Line Busy, Conference, etc - instead putting all those outcome values in a switch block which then execute specific function that outcome. I am trying to find away without using switch block.. Something like: outcome('VoiceMail') { } ..
@Trasiva yea, I've had one (out of like 100+ matches) where the guy had a set of cards I hadn't even seen before
otherwise it's been pretty well balanced for me
maybe they changed it up?
blizz likes to change shit quite often
20:56
@rlemon Looks like a shit yu-gi-oh
I got my modal to show up on click of refresh button but, now when you click on a trip from this page it shows up because of this:
if (!window.location.hash) {
    window.location.hash = 'the-id';
}
@BenFortune it is warcraft version of Magic
basically.
!!afk going home
@I'll-Be-Back: you could try something like pastebin.com/vuwZJ06n
I created an ugly workaround but I don't like it. What I did was on the saved.php page the previous trip links now include #! after ?id=$id
because #! closes the modal

« first day (1773 days earlier)      last day (3400 days later) »