Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
[CB-1494] weinre - Supports running server behind a proxy, such as He…
…roku Cedar

Easiest thing to do is just neuter the remote address check in
the getChannel() function in the weinre.server/lib/
source file.

All this provided before was a simplistic check to make sure the
requests always were coming from the same remote address; for
someone who wanted to cheat, there were ways of cheating, and so
still are.  For everyone else, you can now run under proxy servers
  • Loading branch information
pmuellr committed Nov 30, 2012
1 parent de980f8 commit 19454cfe2cd3c4515f7fb615f35fa2c7b2565401
Showing 2 changed files with 16 additions and 15 deletions.
@@ -52,6 +52,7 @@ <h2>2012/??/?? - version 2.0.0</h2>
<li><a href="">CB-1759</a> - doc indicates that you should launch weinre with a command prefix of `node`
<li><a href="">CB-1193</a> - add Windows Phone support
<li><a href="">CB-1800</a> - remove references to "incubator"
<li><a href="">CB-1494</a> - Supports running server behind a proxy, such as Heroku Cedar

<!-- ======================================================================= -->
@@ -39,7 +39,7 @@ utils.registerClass class ChannelManager

WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
WeinreTargetEvents = serviceManager.get 'WeinreTargetEvents'

if !WeinreClientEvents
utils.exit 'WeinreClientEvents service not registered'

@@ -49,7 +49,7 @@ utils.registerClass class ChannelManager
created: (channel) ->
@channels[] = channel

destroyed: (channel) ->
if channel.isClient
@@ -58,44 +58,44 @@ utils.registerClass class ChannelManager
for connection in channel.connections
@disconnectChannels(connection, channel)

clients = @getClientChannels(

if channel.isClient
if channel.isClient

delete @channels[]
delete @channels[]

getChannel: (name, remoteAddress) ->
return null if !_.has(@channels, name)

channel = @channels[name]

return null if !channel
if remoteAddress
return null if channel.remoteAddress != remoteAddress

# if remoteAddress
# return null if channel.remoteAddress != remoteAddress


connectChannels: (client, target) ->
return if client.isClosed or target.isClosed

if client.connections.length
@disconnectChannels(client, client.connections[0])

client.connections.push target
target.connections.push client

clients = @getClientChannels(


disconnectChannels: (client, target) ->

@@ -106,7 +106,7 @@ utils.registerClass class ChannelManager

client.connections = _.without(client.connections, target)
target.connections = _.without(target.connections, client)

getChannels: (id) ->
if id?

0 comments on commit 19454cf

Please sign in to comment.