•A novel deep learning method for efficient HTTPS traffic classification.•Bidirectional GRU to extract forward and backward features of byte sequences.•Attention mechanism to focus on useful features for traffic classification.•Transfer learning is adopted for re-training the model quickly.•Reduce the number of parameters of the model by 7 times compared with the baseline.