{"action":"created","comment":{"url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/comments/188627213","pull_request_review_id":120625154,"id":188627213,"diff_hunk":"@@ -261,5 +283,103 @@ public void addSeparator() {\n \t\tpublic void addEndButton(JButton button) {\n \t\t\tmessagePanel.addOptions(button, HttpPanel.OptionsLocation.END);\n \t\t}\n+\n+\t\tprivate JButton getBtnReopen(WebSocketPanelSender sender) {\n+\t\t\tif (btnReopen == null) {\n+\t\t\t\tbtnReopen = new JButton();\n+\t\t\t\tbtnReopen.setIcon(REOPEN_ICON);\n+\t\t\t\tbtnReopen.setEnabled(true);\n+\t\t\t\tbtnReopen.setToolTipText(Constant.messages.getString(\"websocket.manual_send.btn_reopen_hint\"));\n+\t\t\t\tbtnReopen.addActionListener(e -> {\n+\t\t\t\t\tif(wsUiHelper.isAlwaysGenerate()){\n+\t\t\t\t\t\tnewSecWebSocketKey = WebSocketUtils.generateSecWebSocketKey();\n+\t\t\t\t\t}else {\n+\t\t\t\t\t\tnewSecWebSocketKey = (wsUiHelper.isGenerateKeyPressed() ? wsUiHelper.getWebSocketKey() : null);\n+\t\t\t\t\t}\n+\t\t\t\t\tPersistentConnectionListener persistentConnectionListener = new PersistentConnectionListener() {\n+\t\t\t\t\t\t@Override\n+\t\t\t\t\t\tpublic boolean onHandshakeResponse(HttpMessage httpMessage, Socket socket, ZapGetMethod zapGetMethod) {\n+\n+\t\t\t\t\t\t\treturn false;\n+\t\t\t\t\t\t}\n+\n+\t\t\t\t\t\t@Override\n+\t\t\t\t\t\tpublic int getArrangeableListenerOrder() {\n+\t\t\t\t\t\t\treturn 0;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t};\n+\t\t\t\t\tif(!sender.reOpenChannel(wsUiHelper.getSelectedChannelId(), newSecWebSocketKey, wsUiHelper.isRedirection(), wsUiHelper.isTrackingSession())){\n+\t\t\t\t\t\tView.getSingleton().showWarningDialog(Constant.messages.getString(\"websocket.manual_send.fail.unable_reopen\"));\n+\t\t\t\t\t}\n+\t\t\t\t});\n+\t\t\t}\n+\t\t\treturn btnReopen;\n+\t\t}\n+\n+\t\tprivate JButton getBtnReopenEdit(WebSocketPanelSender sender){\n+\t\t\tif(btnReopenEdit == null) {\n+\t\t\t\tbtnReopenEdit = new JButton();\n+\t\t\t\tbtnReopenEdit.setIcon(REOPEN_EDIT_ICON);\n+\t\t\t\tbtnReopenEdit.setEnabled(true);\n+\t\t\t\tbtnReopenEdit.setToolTipText(Constant.messages.getString(\"websocket.manual_send.btn_reopen_edit_hint\"));\n+\t\t\t\tbtnReopenEdit.addActionListener(e -> {\n+\t\t\t\t\ttry {\n+\t\t\t\t\t\twsUiHelper.setSecWebsocketKeyField(sender.getSecWebKeyFrom(wsUiHelper.getSelectedChannelId()));\n+\t\t\t\t\t\tJOptionPane.showMessageDialog(this, getReopenPanel(),\n+\t\t\t\t\t\t\t\tConstant.messages.getString(\"websocket.manual_send.adv_dialog.title\"),\n+\t\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n+\t\t\t\t\t} catch (IllegalArgumentException e1) {\n+\t\t\t\t\t\tView.getSingleton().showWarningDialog(Constant.messages.getString(\"websocket.manual_send.fail.invalid_channel\"));\n+\t\t\t\t\t} catch (DatabaseException e1) {\n+\t\t\t\t\t\tLOGGER.info(e1.getStackTrace().toString());","path":"src/org/zaproxy/zap/extension/websocket/manualsend/ManualWebSocketSendEditorDialog.java","position":166,"original_position":166,"commit_id":"2faa03a870dfc5c7c9b0c7b3fc337957deebce0a","original_commit_id":"2faa03a870dfc5c7c9b0c7b3fc337957deebce0a","user":{"login":"thc202","id":4639210,"avatar_url":"https://avatars0.githubusercontent.com/u/4639210?v=4","gravatar_id":"","url":"https://api.github.com/users/thc202","html_url":"https://github.com/thc202","followers_url":"https://api.github.com/users/thc202/followers","following_url":"https://api.github.com/users/thc202/following{/other_user}","gists_url":"https://api.github.com/users/thc202/gists{/gist_id}","starred_url":"https://api.github.com/users/thc202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thc202/subscriptions","organizations_url":"https://api.github.com/users/thc202/orgs","repos_url":"https://api.github.com/users/thc202/repos","events_url":"https://api.github.com/users/thc202/events{/privacy}","received_events_url":"https://api.github.com/users/thc202/received_events","type":"User","site_admin":false},"body":"We should inform the user with a dialogue in this case too (this and following catch could be merged).","created_at":"2018-05-16T13:37:53Z","updated_at":"2018-05-16T13:40:38Z","html_url":"https://github.com/zaproxy/zap-extensions/pull/1618#discussion_r188627213","pull_request_url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/comments/188627213"},"html":{"href":"https://github.com/zaproxy/zap-extensions/pull/1618#discussion_r188627213"},"pull_request":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618"}}},"pull_request":{"url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618","id":187448482,"html_url":"https://github.com/zaproxy/zap-extensions/pull/1618","diff_url":"https://github.com/zaproxy/zap-extensions/pull/1618.diff","patch_url":"https://github.com/zaproxy/zap-extensions/pull/1618.patch","issue_url":"https://api.github.com/repos/zaproxy/zap-extensions/issues/1618","number":1618,"state":"open","locked":false,"title":"Reopen WebSocket Connection in order to send manual messages","user":{"login":"ManosMagnus","id":10010230,"avatar_url":"https://avatars3.githubusercontent.com/u/10010230?v=4","gravatar_id":"","url":"https://api.github.com/users/ManosMagnus","html_url":"https://github.com/ManosMagnus","followers_url":"https://api.github.com/users/ManosMagnus/followers","following_url":"https://api.github.com/users/ManosMagnus/following{/other_user}","gists_url":"https://api.github.com/users/ManosMagnus/gists{/gist_id}","starred_url":"https://api.github.com/users/ManosMagnus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManosMagnus/subscriptions","organizations_url":"https://api.github.com/users/ManosMagnus/orgs","repos_url":"https://api.github.com/users/ManosMagnus/repos","events_url":"https://api.github.com/users/ManosMagnus/events{/privacy}","received_events_url":"https://api.github.com/users/ManosMagnus/received_events","type":"User","site_admin":false},"body":"Reopen WebSocket Connection in order to send manual messages.\r\n\r\nadd-on zaproxy/zaproxy#4290\r\n     \r\nAdd two new Button to the Websocket Manual Send Dialog. One to Re-Establish\r\nwebsocket connection and an other one to configure the process. \r\n\r\n+ Re-Establishing\r\nGet the handshake request of a specific websocket connection (either closed or opened) and resend them in order to establish new one. Create new class `WebSocketReopenSend` in order to send a clone of the initial Http Upgrade Request connection and notify the persistent Connection Listener `ExtensionWebSocket`. `ExtensionWebSocket` hear the new response from the server, informs Http History and creates a new WebSocket Channel.  \r\n\r\n+ Configuration of the process (with new dialog)\r\nUser has the ability to generate new `Sec-WebSocket-Key` every time is going to establish new connection. In addition,  has the option to allow/prevent the redirections (if any), use state or stateless http request as well.\r\n       \r\n + [ ] TODO\r\n    + [ ] Check if the state http request work properly.  ( I haven't found yet any appropriate web application)\r\n     +  [ ] Check if it is any redirection. ( I haven't found yet any appropriate web application)\r\n     + [x] Handle the ping-pong response/request.         \r\n","created_at":"2018-05-11T12:20:20Z","updated_at":"2018-05-16T13:40:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2752140696c07cb2cbbcebcabb679eb4d6f31eb0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618/commits","review_comments_url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618/comments","review_comment_url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zaproxy/zap-extensions/issues/1618/comments","statuses_url":"https://api.github.com/repos/zaproxy/zap-extensions/statuses/2faa03a870dfc5c7c9b0c7b3fc337957deebce0a","head":{"label":"ManosMagnus:iss4290","ref":"iss4290","sha":"2faa03a870dfc5c7c9b0c7b3fc337957deebce0a","user":{"login":"ManosMagnus","id":10010230,"avatar_url":"https://avatars3.githubusercontent.com/u/10010230?v=4","gravatar_id":"","url":"https://api.github.com/users/ManosMagnus","html_url":"https://github.com/ManosMagnus","followers_url":"https://api.github.com/users/ManosMagnus/followers","following_url":"https://api.github.com/users/ManosMagnus/following{/other_user}","gists_url":"https://api.github.com/users/ManosMagnus/gists{/gist_id}","starred_url":"https://api.github.com/users/ManosMagnus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManosMagnus/subscriptions","organizations_url":"https://api.github.com/users/ManosMagnus/orgs","repos_url":"https://api.github.com/users/ManosMagnus/repos","events_url":"https://api.github.com/users/ManosMagnus/events{/privacy}","received_events_url":"https://api.github.com/users/ManosMagnus/received_events","type":"User","site_admin":false},"repo":{"id":123298911,"name":"zap-extensions","full_name":"ManosMagnus/zap-extensions","owner":{"login":"ManosMagnus","id":10010230,"avatar_url":"https://avatars3.githubusercontent.com/u/10010230?v=4","gravatar_id":"","url":"https://api.github.com/users/ManosMagnus","html_url":"https://github.com/ManosMagnus","followers_url":"https://api.github.com/users/ManosMagnus/followers","following_url":"https://api.github.com/users/ManosMagnus/following{/other_user}","gists_url":"https://api.github.com/users/ManosMagnus/gists{/gist_id}","starred_url":"https://api.github.com/users/ManosMagnus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManosMagnus/subscriptions","organizations_url":"https://api.github.com/users/ManosMagnus/orgs","repos_url":"https://api.github.com/users/ManosMagnus/repos","events_url":"https://api.github.com/users/ManosMagnus/events{/privacy}","received_events_url":"https://api.github.com/users/ManosMagnus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ManosMagnus/zap-extensions","description":"OWASP ZAP Add-ons","fork":true,"url":"https://api.github.com/repos/ManosMagnus/zap-extensions","forks_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/forks","keys_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/teams","hooks_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/hooks","issue_events_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/events","assignees_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/tags","blobs_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/languages","stargazers_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/stargazers","contributors_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/contributors","subscribers_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/subscribers","subscription_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/subscription","commits_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/merges","archive_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/downloads","issues_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/labels{/name}","releases_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/ManosMagnus/zap-extensions/deployments","created_at":"2018-02-28T14:48:58Z","updated_at":"2018-05-11T13:51:14Z","pushed_at":"2018-05-16T10:08:16Z","git_url":"git://github.com/ManosMagnus/zap-extensions.git","ssh_url":"git@github.com:ManosMagnus/zap-extensions.git","clone_url":"https://github.com/ManosMagnus/zap-extensions.git","svn_url":"https://github.com/ManosMagnus/zap-extensions","homepage":"","size":883399,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zaproxy:master","ref":"master","sha":"d0b04cd3214cdc738c669ba78238dc9d055c42f4","user":{"login":"zaproxy","id":6716868,"avatar_url":"https://avatars2.githubusercontent.com/u/6716868?v=4","gravatar_id":"","url":"https://api.github.com/users/zaproxy","html_url":"https://github.com/zaproxy","followers_url":"https://api.github.com/users/zaproxy/followers","following_url":"https://api.github.com/users/zaproxy/following{/other_user}","gists_url":"https://api.github.com/users/zaproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/zaproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaproxy/subscriptions","organizations_url":"https://api.github.com/users/zaproxy/orgs","repos_url":"https://api.github.com/users/zaproxy/repos","events_url":"https://api.github.com/users/zaproxy/events{/privacy}","received_events_url":"https://api.github.com/users/zaproxy/received_events","type":"Organization","site_admin":false},"repo":{"id":35210580,"name":"zap-extensions","full_name":"zaproxy/zap-extensions","owner":{"login":"zaproxy","id":6716868,"avatar_url":"https://avatars2.githubusercontent.com/u/6716868?v=4","gravatar_id":"","url":"https://api.github.com/users/zaproxy","html_url":"https://github.com/zaproxy","followers_url":"https://api.github.com/users/zaproxy/followers","following_url":"https://api.github.com/users/zaproxy/following{/other_user}","gists_url":"https://api.github.com/users/zaproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/zaproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaproxy/subscriptions","organizations_url":"https://api.github.com/users/zaproxy/orgs","repos_url":"https://api.github.com/users/zaproxy/repos","events_url":"https://api.github.com/users/zaproxy/events{/privacy}","received_events_url":"https://api.github.com/users/zaproxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zaproxy/zap-extensions","description":"OWASP ZAP Add-ons","fork":false,"url":"https://api.github.com/repos/zaproxy/zap-extensions","forks_url":"https://api.github.com/repos/zaproxy/zap-extensions/forks","keys_url":"https://api.github.com/repos/zaproxy/zap-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zaproxy/zap-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zaproxy/zap-extensions/teams","hooks_url":"https://api.github.com/repos/zaproxy/zap-extensions/hooks","issue_events_url":"https://api.github.com/repos/zaproxy/zap-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/zaproxy/zap-extensions/events","assignees_url":"https://api.github.com/repos/zaproxy/zap-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/zaproxy/zap-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/zaproxy/zap-extensions/tags","blobs_url":"https://api.github.com/repos/zaproxy/zap-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zaproxy/zap-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zaproxy/zap-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/zaproxy/zap-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zaproxy/zap-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/zaproxy/zap-extensions/languages","stargazers_url":"https://api.github.com/repos/zaproxy/zap-extensions/stargazers","contributors_url":"https://api.github.com/repos/zaproxy/zap-extensions/contributors","subscribers_url":"https://api.github.com/repos/zaproxy/zap-extensions/subscribers","subscription_url":"https://api.github.com/repos/zaproxy/zap-extensions/subscription","commits_url":"https://api.github.com/repos/zaproxy/zap-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/zaproxy/zap-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/zaproxy/zap-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/zaproxy/zap-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/zaproxy/zap-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/zaproxy/zap-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zaproxy/zap-extensions/merges","archive_url":"https://api.github.com/repos/zaproxy/zap-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zaproxy/zap-extensions/downloads","issues_url":"https://api.github.com/repos/zaproxy/zap-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/zaproxy/zap-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/zaproxy/zap-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/zaproxy/zap-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zaproxy/zap-extensions/labels{/name}","releases_url":"https://api.github.com/repos/zaproxy/zap-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/zaproxy/zap-extensions/deployments","created_at":"2015-05-07T09:17:13Z","updated_at":"2018-05-16T01:41:07Z","pushed_at":"2018-05-16T10:08:18Z","git_url":"git://github.com/zaproxy/zap-extensions.git","ssh_url":"git@github.com:zaproxy/zap-extensions.git","clone_url":"https://github.com/zaproxy/zap-extensions.git","svn_url":"https://github.com/zaproxy/zap-extensions","homepage":"","size":901979,"stargazers_count":219,"watchers_count":219,"language":"HTML","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":245,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":245,"open_issues":17,"watchers":219,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618"},"html":{"href":"https://github.com/zaproxy/zap-extensions/pull/1618"},"issue":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/issues/1618"},"comments":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/issues/1618/comments"},"review_comments":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618/comments"},"review_comment":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/pulls/1618/commits"},"statuses":{"href":"https://api.github.com/repos/zaproxy/zap-extensions/statuses/2faa03a870dfc5c7c9b0c7b3fc337957deebce0a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"thc202"}}