{"action":"opened","number":156,"pull_request":{"url":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156","id":70619804,"html_url":"https://github.com/noplay/python-mysql-replication/pull/156","diff_url":"https://github.com/noplay/python-mysql-replication/pull/156.diff","patch_url":"https://github.com/noplay/python-mysql-replication/pull/156.patch","issue_url":"https://api.github.com/repos/noplay/python-mysql-replication/issues/156","number":156,"state":"open","locked":false,"title":"Allow to specify a pymysql wrapper or subclass","user":{"login":"baloo","id":59060,"avatar_url":"https://avatars.githubusercontent.com/u/59060?v=3","gravatar_id":"","url":"https://api.github.com/users/baloo","html_url":"https://github.com/baloo","followers_url":"https://api.github.com/users/baloo/followers","following_url":"https://api.github.com/users/baloo/following{/other_user}","gists_url":"https://api.github.com/users/baloo/gists{/gist_id}","starred_url":"https://api.github.com/users/baloo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloo/subscriptions","organizations_url":"https://api.github.com/users/baloo/orgs","repos_url":"https://api.github.com/users/baloo/repos","events_url":"https://api.github.com/users/baloo/events{/privacy}","received_events_url":"https://api.github.com/users/baloo/received_events","type":"User","site_admin":false},"body":"This will allow to implement custom transports (tls transport, mysql own\r\nstart tls)\r\n\r\nexample usage:\r\n```python\r\nimport socket\r\n\r\nimport pymysql.connections\r\nfrom pymysql.constants import CLIENT\r\n\r\nclass TLSConnection(pymysql.connections.Connection):\r\n    def __init__(self, *args, **kwargs):\r\n        kwargs['defer_connect'] = True\r\n\r\n        super(TLSConnection, self).__init__(*args, **kwargs)\r\n        self.ssl = False\r\n        self.client_flag &= ~CLIENT.SSL\r\n        sock = socket.create_connection((self.host, self.port), self.connect_timeout)\r\n        self.host_info = \"socket %s:%d\" % (self.host, self.port)\r\n        sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)\r\n        sock = self.ctx.wrap_socket(sock, server_hostname=self.host)\r\n\r\n        self.connect(sock)\r\n\r\nmysql_settings={\r\n    'host': '1.2.3.4',\r\n    'user': 'acme',\r\n    'password': 'hackme',\r\n    'port': 3306,\r\n    'charset': 'utf8mb4',\r\n    'db': '',\r\n    'ssl': {\r\n      'ca': 'root.crt',\r\n      'cert': 'crt',\r\n      'key':  'key',\r\n      'cipher': 'ECDHE-RSA-AES256-GCM-SHA384'\r\n    }\r\n}\r\n\r\nfrom pymysqlreplication import BinLogStreamReader\r\nstream = BinLogStreamReader(connection_settings=mysql_settings, pymysql_wrapper=TLSConnection)\r\n\r\n```\r\n\r\nSigned-off-by: Arthur Gautier <baloo@gandi.net>","created_at":"2016-05-19T00:15:08Z","updated_at":"2016-05-19T00:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156/commits","review_comments_url":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156/comments","review_comment_url":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/comments{/number}","comments_url":"https://api.github.com/repos/noplay/python-mysql-replication/issues/156/comments","statuses_url":"https://api.github.com/repos/noplay/python-mysql-replication/statuses/f5700f588b367795ff9bbbc7ac0b1bb8b6ee05de","head":{"label":"baloo:features/custom_tranport","ref":"features/custom_tranport","sha":"f5700f588b367795ff9bbbc7ac0b1bb8b6ee05de","user":{"login":"baloo","id":59060,"avatar_url":"https://avatars.githubusercontent.com/u/59060?v=3","gravatar_id":"","url":"https://api.github.com/users/baloo","html_url":"https://github.com/baloo","followers_url":"https://api.github.com/users/baloo/followers","following_url":"https://api.github.com/users/baloo/following{/other_user}","gists_url":"https://api.github.com/users/baloo/gists{/gist_id}","starred_url":"https://api.github.com/users/baloo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloo/subscriptions","organizations_url":"https://api.github.com/users/baloo/orgs","repos_url":"https://api.github.com/users/baloo/repos","events_url":"https://api.github.com/users/baloo/events{/privacy}","received_events_url":"https://api.github.com/users/baloo/received_events","type":"User","site_admin":false},"repo":{"id":23456018,"name":"python-mysql-replication","full_name":"baloo/python-mysql-replication","owner":{"login":"baloo","id":59060,"avatar_url":"https://avatars.githubusercontent.com/u/59060?v=3","gravatar_id":"","url":"https://api.github.com/users/baloo","html_url":"https://github.com/baloo","followers_url":"https://api.github.com/users/baloo/followers","following_url":"https://api.github.com/users/baloo/following{/other_user}","gists_url":"https://api.github.com/users/baloo/gists{/gist_id}","starred_url":"https://api.github.com/users/baloo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baloo/subscriptions","organizations_url":"https://api.github.com/users/baloo/orgs","repos_url":"https://api.github.com/users/baloo/repos","events_url":"https://api.github.com/users/baloo/events{/privacy}","received_events_url":"https://api.github.com/users/baloo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baloo/python-mysql-replication","description":"Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL","fork":true,"url":"https://api.github.com/repos/baloo/python-mysql-replication","forks_url":"https://api.github.com/repos/baloo/python-mysql-replication/forks","keys_url":"https://api.github.com/repos/baloo/python-mysql-replication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baloo/python-mysql-replication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baloo/python-mysql-replication/teams","hooks_url":"https://api.github.com/repos/baloo/python-mysql-replication/hooks","issue_events_url":"https://api.github.com/repos/baloo/python-mysql-replication/issues/events{/number}","events_url":"https://api.github.com/repos/baloo/python-mysql-replication/events","assignees_url":"https://api.github.com/repos/baloo/python-mysql-replication/assignees{/user}","branches_url":"https://api.github.com/repos/baloo/python-mysql-replication/branches{/branch}","tags_url":"https://api.github.com/repos/baloo/python-mysql-replication/tags","blobs_url":"https://api.github.com/repos/baloo/python-mysql-replication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baloo/python-mysql-replication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baloo/python-mysql-replication/git/refs{/sha}","trees_url":"https://api.github.com/repos/baloo/python-mysql-replication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baloo/python-mysql-replication/statuses/{sha}","languages_url":"https://api.github.com/repos/baloo/python-mysql-replication/languages","stargazers_url":"https://api.github.com/repos/baloo/python-mysql-replication/stargazers","contributors_url":"https://api.github.com/repos/baloo/python-mysql-replication/contributors","subscribers_url":"https://api.github.com/repos/baloo/python-mysql-replication/subscribers","subscription_url":"https://api.github.com/repos/baloo/python-mysql-replication/subscription","commits_url":"https://api.github.com/repos/baloo/python-mysql-replication/commits{/sha}","git_commits_url":"https://api.github.com/repos/baloo/python-mysql-replication/git/commits{/sha}","comments_url":"https://api.github.com/repos/baloo/python-mysql-replication/comments{/number}","issue_comment_url":"https://api.github.com/repos/baloo/python-mysql-replication/issues/comments{/number}","contents_url":"https://api.github.com/repos/baloo/python-mysql-replication/contents/{+path}","compare_url":"https://api.github.com/repos/baloo/python-mysql-replication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baloo/python-mysql-replication/merges","archive_url":"https://api.github.com/repos/baloo/python-mysql-replication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baloo/python-mysql-replication/downloads","issues_url":"https://api.github.com/repos/baloo/python-mysql-replication/issues{/number}","pulls_url":"https://api.github.com/repos/baloo/python-mysql-replication/pulls{/number}","milestones_url":"https://api.github.com/repos/baloo/python-mysql-replication/milestones{/number}","notifications_url":"https://api.github.com/repos/baloo/python-mysql-replication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baloo/python-mysql-replication/labels{/name}","releases_url":"https://api.github.com/repos/baloo/python-mysql-replication/releases{/id}","deployments_url":"https://api.github.com/repos/baloo/python-mysql-replication/deployments","created_at":"2014-08-29T07:20:39Z","updated_at":"2014-08-28T12:54:03Z","pushed_at":"2016-05-19T00:14:38Z","git_url":"git://github.com/baloo/python-mysql-replication.git","ssh_url":"git@github.com:baloo/python-mysql-replication.git","clone_url":"https://github.com/baloo/python-mysql-replication.git","svn_url":"https://github.com/baloo/python-mysql-replication","homepage":null,"size":437,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"noplay:master","ref":"master","sha":"0d99b6a8cf871908b583dc1ea6845fd254f80e9c","user":{"login":"noplay","id":345437,"avatar_url":"https://avatars.githubusercontent.com/u/345437?v=3","gravatar_id":"","url":"https://api.github.com/users/noplay","html_url":"https://github.com/noplay","followers_url":"https://api.github.com/users/noplay/followers","following_url":"https://api.github.com/users/noplay/following{/other_user}","gists_url":"https://api.github.com/users/noplay/gists{/gist_id}","starred_url":"https://api.github.com/users/noplay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noplay/subscriptions","organizations_url":"https://api.github.com/users/noplay/orgs","repos_url":"https://api.github.com/users/noplay/repos","events_url":"https://api.github.com/users/noplay/events{/privacy}","received_events_url":"https://api.github.com/users/noplay/received_events","type":"User","site_admin":false},"repo":{"id":5819063,"name":"python-mysql-replication","full_name":"noplay/python-mysql-replication","owner":{"login":"noplay","id":345437,"avatar_url":"https://avatars.githubusercontent.com/u/345437?v=3","gravatar_id":"","url":"https://api.github.com/users/noplay","html_url":"https://github.com/noplay","followers_url":"https://api.github.com/users/noplay/followers","following_url":"https://api.github.com/users/noplay/following{/other_user}","gists_url":"https://api.github.com/users/noplay/gists{/gist_id}","starred_url":"https://api.github.com/users/noplay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noplay/subscriptions","organizations_url":"https://api.github.com/users/noplay/orgs","repos_url":"https://api.github.com/users/noplay/repos","events_url":"https://api.github.com/users/noplay/events{/privacy}","received_events_url":"https://api.github.com/users/noplay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/noplay/python-mysql-replication","description":"Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL","fork":false,"url":"https://api.github.com/repos/noplay/python-mysql-replication","forks_url":"https://api.github.com/repos/noplay/python-mysql-replication/forks","keys_url":"https://api.github.com/repos/noplay/python-mysql-replication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/noplay/python-mysql-replication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/noplay/python-mysql-replication/teams","hooks_url":"https://api.github.com/repos/noplay/python-mysql-replication/hooks","issue_events_url":"https://api.github.com/repos/noplay/python-mysql-replication/issues/events{/number}","events_url":"https://api.github.com/repos/noplay/python-mysql-replication/events","assignees_url":"https://api.github.com/repos/noplay/python-mysql-replication/assignees{/user}","branches_url":"https://api.github.com/repos/noplay/python-mysql-replication/branches{/branch}","tags_url":"https://api.github.com/repos/noplay/python-mysql-replication/tags","blobs_url":"https://api.github.com/repos/noplay/python-mysql-replication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/noplay/python-mysql-replication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/noplay/python-mysql-replication/git/refs{/sha}","trees_url":"https://api.github.com/repos/noplay/python-mysql-replication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/noplay/python-mysql-replication/statuses/{sha}","languages_url":"https://api.github.com/repos/noplay/python-mysql-replication/languages","stargazers_url":"https://api.github.com/repos/noplay/python-mysql-replication/stargazers","contributors_url":"https://api.github.com/repos/noplay/python-mysql-replication/contributors","subscribers_url":"https://api.github.com/repos/noplay/python-mysql-replication/subscribers","subscription_url":"https://api.github.com/repos/noplay/python-mysql-replication/subscription","commits_url":"https://api.github.com/repos/noplay/python-mysql-replication/commits{/sha}","git_commits_url":"https://api.github.com/repos/noplay/python-mysql-replication/git/commits{/sha}","comments_url":"https://api.github.com/repos/noplay/python-mysql-replication/comments{/number}","issue_comment_url":"https://api.github.com/repos/noplay/python-mysql-replication/issues/comments{/number}","contents_url":"https://api.github.com/repos/noplay/python-mysql-replication/contents/{+path}","compare_url":"https://api.github.com/repos/noplay/python-mysql-replication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/noplay/python-mysql-replication/merges","archive_url":"https://api.github.com/repos/noplay/python-mysql-replication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/noplay/python-mysql-replication/downloads","issues_url":"https://api.github.com/repos/noplay/python-mysql-replication/issues{/number}","pulls_url":"https://api.github.com/repos/noplay/python-mysql-replication/pulls{/number}","milestones_url":"https://api.github.com/repos/noplay/python-mysql-replication/milestones{/number}","notifications_url":"https://api.github.com/repos/noplay/python-mysql-replication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/noplay/python-mysql-replication/labels{/name}","releases_url":"https://api.github.com/repos/noplay/python-mysql-replication/releases{/id}","deployments_url":"https://api.github.com/repos/noplay/python-mysql-replication/deployments","created_at":"2012-09-15T09:39:08Z","updated_at":"2016-05-17T08:37:44Z","pushed_at":"2016-05-17T04:28:42Z","git_url":"git://github.com/noplay/python-mysql-replication.git","ssh_url":"git@github.com:noplay/python-mysql-replication.git","clone_url":"https://github.com/noplay/python-mysql-replication.git","svn_url":"https://github.com/noplay/python-mysql-replication","homepage":null,"size":688,"stargazers_count":434,"watchers_count":434,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":128,"mirror_url":null,"open_issues_count":23,"forks":128,"open_issues":23,"watchers":434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156"},"html":{"href":"https://github.com/noplay/python-mysql-replication/pull/156"},"issue":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/issues/156"},"comments":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/noplay/python-mysql-replication/statuses/f5700f588b367795ff9bbbc7ac0b1bb8b6ee05de"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":9,"deletions":3,"changed_files":1}}