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

inspector: perform DNS lookup for host #13478

Merged
merged 1 commit into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,7 @@ void Url(const FunctionCallbackInfo<Value>& args) {

if (ids.empty()) return;

std::string url = "ws://";
url += io->host();
url += ":";
url += std::to_string(io->port());
url += "/";
url += ids[0];

std::string url = FormatWsAddress(io->host(), io->port(), ids[0], true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves the IPv6 URL bug 👍

args.GetReturnValue().Set(OneByteString(env->isolate(), url.c_str()));
}

Expand Down
2 changes: 1 addition & 1 deletion src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void InspectorIo::ThreadMain() {
uv_sem_post(&thread_start_sem_);
return;
}
port_ = server.port(); // Safe, main thread is waiting on semaphore.
port_ = server.Port(); // Safe, main thread is waiting on semaphore.
if (!wait_for_connect_) {
uv_sem_post(&thread_start_sem_);
}
Expand Down
4 changes: 4 additions & 0 deletions src/inspector_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class StringView;
namespace node {
namespace inspector {

std::string FormatWsAddress(const std::string& host, int port,
const std::string& target_id,
bool include_protocol);

class InspectorIoDelegate;

enum class InspectorAction {
Expand Down
1 change: 1 addition & 0 deletions src/inspector_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class InspectorSocket {
bool ws_mode;
bool shutting_down;
bool connection_eof;

private:
DISALLOW_COPY_AND_ASSIGN(InspectorSocket);
};
Expand Down
Loading